CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.
-
Upload
victoria-horn -
Category
Documents
-
view
229 -
download
0
Transcript of CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.
![Page 1: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/1.jpg)
1
CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE
Instructor: Dr. Anwar Mamat
Winter 2015
![Page 2: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/2.jpg)
Course Objectives
At the end of this class you will be able to: Create web pages using HTML, CSS Use PHP server programming Submit Forms Cookies and Sessions Files and Directories Relational Database and MySQL SQL queries Interacting with MySQL using PHP
2
![Page 3: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/3.jpg)
3
Why did you take CMSC389P?
![Page 4: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/4.jpg)
Lectures
We meet at 11:30am-12:30pm, everyday, at CSI 2117
Check the schedule in the class webpage Password protected sections.
User: cmsc389p, password:webprogramming
Read the syllabus and policies carefully Check piazza.com for discussions and
questions. Search CMSC389p, Spring 2015. No
winter option.
6
![Page 5: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/5.jpg)
How to get help
office hours: Monday through Thursday, immediately after class.
Or set an appointment with me via e-mail
No textbook. Reference:
“Web Programming Step by Step” by Marty Stepp, Jessica Miller,
Victoria Kirst
7
![Page 6: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/6.jpg)
Grading
Projects will be posted online on the class webpage
8
Project 1 15%Project 2 20%Project 3 25%Project 4 40%Total 100%
![Page 7: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/7.jpg)
7
Policies
You may discuss homework problems with classmates, after you have made a serious effort in trying the homework on your own.
You can use ideas from the literature (with proper citation).
You can use anything from the lectures/notes.
The code you submit must be written completely by you.
![Page 8: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/8.jpg)
Software Installation Alternatives for Apache, MySQL, and PHP
Individual installation of packages (See Resources section, web page) Bundles (include Apace, MySQL, PHP, OpenSSL, etc.) XAMPP (Linux, Windows)
http://www.apachefriends.org/en/xampp.html Mac is also supported although you may want to try MAMP(see
below) MAMP Macintosh, Apache, MySQL, and PHP
http://www.mamp.info/en/mamp.html We are using free version (Not MAMP PRO)
Alternatives for Editors Notepad/WordPad or any other text editor Komodo Edit
http://www.activestate.com/komodo_edit/ Do not confuse with Komodo IDE (Not free) Works in Windows, Max, Linux
Eclipse + PHP Plugin Instructions available at http://www.zend.com/en/community/pdt
Your assignment for tomorrow Install Apache and PHP
8
![Page 9: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/9.jpg)
9
Web Hosting
As a student of the university you have a directory (folder) where you can place your html documents so they can be accessed on the web
Location of your folder Machine: terpconnect.umd.edu Login by using your directoryID/Password combination Folder location: /pub/YOURDIRECTORYID
To activate: Visit http://www.it.umd.edu/new/
Web Page Address: http://www.terpconnect.umd.edu/~YOURDIRECTORYID Notice there is a ~ before your directory id
Software/Instructions to Transfer Data http://www.cs.umd.edu/~nelson/classes/utilities/TransferingDataToTerp
connect/
Free/Low Cost web hosting http://www.cs.umd.edu/~nelson/nicesites/SmallBusinessWebsites.html
![Page 10: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/10.jpg)
The INTERNET… and a bit of history15
![Page 11: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/11.jpg)
11
What is the internet?
A collection of computer networks that use a protocol to exchange data
Is the World Wide Web (WWW) and the internet the same?
![Page 12: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/12.jpg)
12
Brief history
Began as a US Department of Defense network called ARPANET (1960s-70s) Packet switching (in the 60s) E-mail is born on 1971 TCP/IP beginning on 1974 (Vinton Cerf) USENET (1979) By 1987: Internet includes nearly 30,000 hosts
![Page 13: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/13.jpg)
13
Brief history (cont.)
WWW created in 1989-91 by Tim Berners-Lee
Popular web browsers released: Netscape 1994 IE 1995
Amazon.com opens in 1995 Google January 1996 Wikipedia launched in 2001 MySpace opens in 2003 Facebook February 2004
![Page 14: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/14.jpg)
CS38014
Wikipedia launched in 2001 MySpace opens in 2003 Facebook February 2004
![Page 15: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/15.jpg)
15
The future of the internet?
![Page 16: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/16.jpg)
16
Key aspects of the internet
Sub-networks are independent Computers can dynamically join and
leave the network Built on open standards Lack of centralized control (mostly) Everyone can use it with simple,
commonly available software
![Page 17: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/17.jpg)
17
People and organizations
Internet Engineering Task Force (IETF): internet protocol standards
Internet Corporation for Assigned Names and Numbers (ICANN): decides top-level domain names
World Wide Web Consortium (W3C): web standards
![Page 18: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/18.jpg)
Layered architecture
![Page 19: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/19.jpg)
CS380
19
Internet Protocol (IP)
Simple protocol for data exchange between computers
IP Addresses: 32-bit for IPv5 128-bit for IPv6
![Page 20: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/20.jpg)
20
Transmission Control Protocol (TCP) Adds multiplexing, guaranteed message
delivery on top of IP Multiplexing: multiple programs using the
same IP address Port: a number given to each program or
service port 80: web browser (port 443 for secure
browsing) port 25: email port 22: ssh
Some programs (games, streaming media programs) use simpler UDP protocol instead of TCP
![Page 21: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/21.jpg)
21
Web Servers
Web server: software that listens for web page requests Apache Microsoft Internet Information Server (IIS)
![Page 22: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/22.jpg)
22
Application Server
Software framework that provides an environment where applications can run Apache Glassfish WebSphere WebLogic
![Page 23: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/23.jpg)
23
Web Browser
Web browser: fetches/displays documents from web servers Mozilla Firefox Microsoft Internet Explorer (IE) Apple Safari Google Chrome Opera
![Page 24: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/24.jpg)
24
Domain Name Server (DNS)
Set of servers that map written names to IP addresses Example: umd.edu → 54.84.241.99
Many systems maintain a local cache called a hosts file Windows: C:\Windows\system32\drivers\
etc\hosts Mac: /private/etc/hosts Linux: /etc/hosts
![Page 25: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/25.jpg)
25
Uniform Resource Locator (URL) Identifier for the location of a document
on a web site Example: http://cs.umd.edu/index.html
Upon entering this URL into the browser, it would: ask the DNS server for the IP address of
dept.ju.edu connect to that IP address at port 80 ask the server to GET /index.html display the resulting page on the screen
![Page 26: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/26.jpg)
26
Hypertext Transport Protocol (HTTP) Set of commands understood by a web
server and sent from a browser Some HTTP commands (your browser
sends these internally): GET filename : download POST filename : send a web form response PUT filename : upload
Exercise: simulate a browser with a terminal window
![Page 27: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/27.jpg)
27
HTTP Error Codes
When something goes wrong, the web server returns a special "error code" number
Common error codes:Number Meaning200 OK
301-303page has moved (permanently or temporarily)
403 you are forbidden to access this page
404 page not found
500 internal server error
![Page 28: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/28.jpg)
28
Internet Media (“MIME”) types
MIME type file extension
text/html .html
text/plain .txt
image/gif .gif
image/jpeg .jpg
video/quicktime .mov
application/octet-stream .exe
![Page 29: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/29.jpg)
29
Web Languages
Hypertext Markup Language (HTML): used for writing web pages
Cascading Style Sheets (CSS): stylistic info for web pages
PHP Hypertext Processor (PHP): dynamically create pages on a web server
JavaScript: interactive and programmable web pages
![Page 30: CMSC389P: INTRODUCTION TO PHP, MYSQL AND APACHE Instructor: Dr. Anwar Mamat 1 Winter 2015.](https://reader036.fdocuments.net/reader036/viewer/2022062320/56649d815503460f94a6655e/html5/thumbnails/30.jpg)
30
Web Languages(cont.)
Asynchronous JavaScript and XML (Ajax): accessing data for web applications
eXtensible Markup Language (XML): metalanguage for organizing data