<<

MCIS/UA PHP Training 2003 Chapter 1 PHPIntroduction Survey • Have you ever written a web application? • Have you used any of the following languages? • C • C++ • Java • Perl • Have you ever written an object-oriented program? PHP Agenda for the course

• PHP • Web Application concepts and techniques • MU LibrariesPHP 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', 'xslt_name' => $cfg_xslt, 'was_enabled' => 1, )); PHP Why change?

• Support • Stability • Compatibility • Features • Cost PHP What is a Web Application?

• Goal: Dynamically generated HTML • Server-side • StatelessPHP What is PHP? • Personal Home Page Tools • PHP: Hypertext Preprocessor • 1995 - version 1.0 • Web application development environment • similar to Cold Fusion, JSP, ASP, Web Objects, ... • Server-side • Open-Source • Free PHP What is PHP? • Supported? • Zend • Internet • Can be embedded in HTML • Compiled at run-time • C-derived syntax • similar to C, C++, Perl, Java, etc. • Object-orientedPHP What can PHP do?

• Platforms • Linux, FreeBSD, Sun Solaris, HP/UX, IBM AIX, MS Windows, Mac OS X, ... • Apache, Microsoft IIS, Netscape/iPlanet, ... • Databases • Oracle, Sybase, DB2, MySQL, PostgreSQL, Ingres, dBase, ODBCPHP, Adabas D, ... What can PHP do? • Output • HTML, XML (SAX and DOM), XSLT, PDF, GIF, JPG, PNG, Flash, ... • Protocols LDAP, IMAP, SNMP, NNTP, POP3, WDDX, SOAP, • CORBA, IRC, FTP, SMTP, SSL, ... • E-commerce • Cybercash, CyberMUT, VeriSign Payflow Pro, CCVS, ...PHP What can PHP do?

, Cast-256, CRC32, CRC32B, DES, Enigma, Gost, HAVAL128, HAVAL160, HAVAL192, HAVAL224, HAVAL256, LOKI97, MD5, Panama, RC2, RC4, RC4-iv, Rijndael-128, Rijndael-192, Rijndael-256, RIPEMD160, Saferplus, Safer- sk64 , Safer-sk128, , SHA1, SSL, Threeway, TIGER, TripleDES,PHP , Wake Web Development Application Usage

ASP 29,371,084

Perl 2,835,762

JSP 2,543,689

WebObjects 1,503,133

PHP 18,748,190 Cold Fusion PHP10,478,951 First Program First Program

PHP First Program

1. FTP to: admsol03.mcs.muohio.edu 2. Change directory to: /usr/local/www/share/htdocs/phpapps 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/uniqueIdPHP/first.php First Program First Program

PHP First Program First Program

PHP First Program First Program

PHP First Program First Program

PHP Homework #1

Rewrite your first program using only PHP

output all HTML here ?> PHP References

http://www.php.net/ http://www.users.muohio.edu/covertka/php/ http://webdev.admin.muohio.edu/phpapps/ http://www.google.com/PHP