MCIS/UA PHP Training 2003 PHP Chapter 1 Introduction
Survey • Have you ever written a web application? • Have you used any of the following languages? • C PHP • C++ • Java • Perl • Have you ever written an object-oriented program?
Agenda for the course • PHP PHP • Web Application concepts and techniques • MU Libraries
Presentation Library PHP
Presentation Library PHP
Presentation Library PHP
Presentation Library PHP
Presentation Library PHP
Presentation Library PHP
Authentication PHP
Authentication check_authenticated_user( array('application_name' => $cfg_appname, 'session_name' => $cfg_sessionname, 'add_nav_func' => 'add_nav', PHP 'xslt_name' => $cfg_xslt, 'was_enabled' => 1, ));
Why change? • Support • Stability • Compatibility PHP • Features • Cost
What is a Web Application? • Goal: Dynamically generated HTML • Server-side PHP • Stateless
What is PHP? • Personal Home Page Tools • PHP: Hypertext Preprocessor • 1995 - version 1.0 • Web application development environment PHP • similar to Cold Fusion, JSP , ASP , Web Objects, ... • Server-side • Open-Source • Free
What is PHP? • Supported? • Zend • Internet • Can be embedded in HTML PHP • Compiled at run-time • C-derived syntax • similar to C, C++, Perl, Java, etc. • Object-oriented
What can PHP do? • Platforms • Linux, FreeBSD, Sun Solaris, HP/UX, IBM AIX, MS Windows, Mac OS X, ... PHP • Apache, Microsoft IIS, Netscape/iPlanet, ... • Databases • Oracle, Sybase, DB2, MySQL, PostgreSQL, Ingres, dBase, ODBC, Adabas D, ...
What can PHP do? • Output • HTML, XML (SAX and DOM), XSLT, PDF, GIF, JPG, PNG, Flash, ... • Protocols PHP • LDAP , IMAP , SNMP , NNTP , POP3, WDDX, SOAP , CORBA, IRC, FTP , SMTP , SSL, ... • E-commerce • Cybercash, CyberMUT, VeriSign Payflow Pro, CCVS, ...
What can PHP do? • Encryption • Blowfish, Cast-256, CRC32, CRC32B, DES, Enigma, Gost, PHP HAVAL128, HAVAL160, HAVAL192, HAVAL224, HAVAL256, LOKI97, MD5, Panama, RC2, RC4, RC4-iv, Rijndael-128, Rijndael-192, Rijndael-256, RIPEMD160, Saferplus, Safer- sk64 xtea, Safer-sk128, Serpent, SHA1, SSL, Threeway, TIGER, TripleDES, Twofish, Wake
Web Development Application Usage ASP 29,371,084 Perl 2,835,762 PHP JSP 2,543,689 WebObjects 1,503,133 PHP 18,748,190 Cold Fusion 10,478,951
First Program <html> <head> <title>First Program</title> </head> <body> PHP <p> <?php print “My first PHP program.”; ?> </p> </body> </html>
First Program 1. FTP to: admsol03.mcs.muohio.edu 2. Change directory to: /usr/local/www/share/htdocs/phpapps PHP 3. Create a new directory with your uniqueId. Change into that directory. 4. Save the program as: first.php 5. Try the program at: http://webdev.admin.muohio.edu/ phpapps/ uniqueId /first.php
First Program <html> <head> <title>First Program</title> </head> <body> PHP <p> <?php print “My first PHP program.”; ?> </p> </body> </html>
First Program <html> <head> <title>First Program</title> </head> <body> PHP <p> <?php print “My first PHP program.”; ?> </p> </body> </html>
First Program <html> <head> <title>First Program</title> </head> <body> PHP <p> <?php print $_SERVER[”HTTP_USER_AGENT”]; ?> </p> </body> </html>
First Program <html> <head> <title>First Program</title> </head> <body> PHP <p> <?php phpinfo(); ?> </p> </body> </html>
Homework #1 Rewrite your first program using only PHP <?php PHP output all HTML here ?>
References http://www.php.net/ http://www.users.muohio.edu/covertka/php/ PHP http://webdev.admin.muohio.edu/phpapps/ http://www.google.com/
Recommend
More recommend