1 / 15

PHP Overview

PHP Overview. for educators and instructional designers By Martin Yeh 06/28/2007. What is PHP?. PHP: Hypertext Preprocessor It is a server-side scripting language. JavaScript (client-side) ASP, JSP (server-side) It is free to download. Often works with Apache and MySQL.

mason-cook
Download Presentation

PHP Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP Overview for educators and instructional designers By Martin Yeh 06/28/2007

  2. What is PHP? • PHP: Hypertext Preprocessor • It is a server-side scripting language. • JavaScript (client-side) • ASP, JSP (server-side) • It is free to download. • Often works with Apache and MySQL. Penn State University Martin Yeh

  3. How Popular is PHP • Top 5 most popular programming language: Java, C, C++, (Visual) Basic, PHP (http://www.tiobe.com/tpci.htm) Penn State University Martin Yeh

  4. Background Knowledge • HTML • Apache: web server • MySQL: database systems • Server-Client: a concept about the relationship of networked computers. Penn State University Martin Yeh

  5. HTTP Request HTTP Request HTTP Response HTTP Response Web Browser (Client) Apache (Server) PHP module How PHP work? • From users’ perspective, this process is transparent Web Browser (Client) Apache (Server) Penn State University Martin Yeh

  6. PHP Scripts • File name extension • depends on server settings. • usually by the extension of .php .php3 .phtml • Inside the script: <?php your php script goes here ?> Penn State University Martin Yeh

  7. First PHP Script • Under Dreamweaver, select File->New, select “Basic page”, “HTML”, and make sure that “Make document XHTML compliant” • Move cursor to the end of <body> • Press “Enter” • Add these three lines: <?php echo “Hello World”; ?> Penn State University Martin Yeh

  8. Completed First Script <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <?php echo “Hello World”; ?> </body> </html> Penn State University Martin Yeh

  9. Let’s See The HTML Source • Save the file, upload it to PSU web space. • Browse this file using any web browser. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> Hello World</body> </html> Penn State University Martin Yeh

  10. What Does PHP Module Do • Executes the scripts embedded inside <?php and ?> • In the first script echo “Hello World”;is executed and the result is simply hello world Penn State University Martin Yeh

  11. Another PHP Script • Type the following code in your favorite text editor and save it to server_info.php. <?php phpinfo(); ?> • Upload it to your PUS personal web space. • Open a browser and point it to http://www.personal.psu.edu/your_psu_id/server_info.php Penn State University Martin Yeh

  12. Penn State University Martin Yeh

  13. Programming & PHP • Input • Getting data from standard input device, files, database systems • PHP: HTML form, read files, connecting to database systems • Process • Your program logics • Output • Standard output device • Files • Database systems Penn State University Martin Yeh

  14. Some PHP Sites • http://wise.berkeley.com • http://www.limesurvey.org • http://wikindx.sourceforge.net • http://www.personal.psu.edu/kqy1/cbr Penn State University Martin Yeh

  15. Dive into PHP • Last updated • Email form Penn State University Martin Yeh

More Related