PHP - Hypertext Preprocessor

2y ago
66 Views
2 Downloads
243.51 KB
20 Pages
Last View : 17d ago
Last Download : 3m ago
Upload by : Julia Hutchens
Transcription

PHP - HypertextPreprocessorYaron BenitaDe Paul University

PHPl Introductionl Historyl Language syntaxl Advantages

What is PHPAn established server-side, crossplatform embedded HTML scriptinglanguage for creating dynamic Webpages.PHP provides many features thatcommercial entities are looking for.

PHP Advantages Exceptionally short learning curveQuick development timeVery high performancesupports all major platforms (UNIX,Windows and even mainframes). Features native support for mostpopular databases

Intranet Design Magazine"PHP was built with the needs of Webdevelopers in mind. Unlike othercumbersome, overhead-ladenapproaches, PHP is lightweight andfocused on the Web - where it can solvecomplex problem scenarios quicker andmore easily than comparabletechnologies."

History of PHPl 1994 - PHP was conceived sometimes inthe Fall of 1994 by Rasmus Lerdorfl 1995 - PHP/FI Version 2. ( IntroducingmySql data base)l 1997 – approximately 50,000 web sites.Introducing PHP Version 3.(Zeev Suraski and Andi Gutmans )l 2000 – PHP 4 was introduced, using“Zend” scripting engine. ( 5.1 millionweb sites. )

PHP-Enabled Web Pagesl Treated just like regular HTMLpages and you can create and editthem the same way you normallycreate regular HTML pages.l As simple as HTML files with awhole new family of magical tagsthat let you do all sorts of things.

Simple Example:File name : Hello.php h t m l h e a d title P H PTest /title / h e a d body ? p h p e c h o " H e l l o W o r l d p " ; ? /body /html

PHP Languagel Condition statements, loop statements,arrays .l Built in libraries. (sorting, list, queue.)l Functions.l Classes. ( Objects, Inheritance . )l String Manipulation. ( Perl )l Built in support forencryption/Decryption functions.( MD5,DES, )

More on PHP Language:l Text files manipulation. ( Read,write, .)l Supports java objects, COMobjects .l Sessions, cookies

A More Useful Example ?php echo HTTP USER AGENT; ? Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) ? p h p p h p i n f o (); ? Alist of all the global variables.

Using if Statements ?phpif(strstr( H T T P U S E R A G E N T ," M SI E " )) { ? center b Y o u are usingInternet Explorer /b /center ? } else { ? center b Y o u are not usingInternet Explorer /b /center ?} ?

Dealing with Formsl One of the most powerful featuresof PHP is the way it handles HTMLformsl Any form element in a form willautomatically result in a variablewith the same name as the elementbeing created on the target page.

FORM Example: HTML Page: form action "action.php" method "post" Your name: input type "text"name "name" You age: input type "text" name "age" i n p u t t y p e " s u b m it" /form action.php.Hi ? p h p e c h o n a m e ; ? .Y o u a r e ? p h p e c h o a g e ; ? years old.

Database Supportl mySQL - PHP and MySQL work very welltogether, in addition to the speed andfeatures of each individual tool.l PHP is open-source, and offersexcellent connectivity to most of today'scommon databases including Oracle,Sybase, MySQL, ODBC (and others).l PHP also offers integration with variousexternal libraries which enable thedeveloper to do anything fromgenerating PDF documents to parsingXML.

MySQL Examplel Connect to MySQL.l Send a query.l Print a table heading.l Print table rows until end of thetable has been reached.

MySQL Example ?php conn mysql connect("localhost", “yaron", ""); res mysql query("SELECT * FROM users", conn); header printed false;print " TABLE \n";do { data mysql fetch array( res);// Retrieve the next row of data.if (!is array( data)) {break;}

MySQL Example (continue)if (! header printed) {print " TR ";reset( data);while (list( name, value) each( data)) {print " TH name /TH \n"}print " /TR \n"; header printed true;}print " TR \n";print " TD ";print implode(" /TD \nprint " /TR \n";} while ( data);print " /TABLE \n";? TD ", data);

Reasons for Using PHPl Speed and robustness.l Superior Memory Managementl No Hidden Costs with PHPl Integration with MySQL database.l Closer to Java/C Style ofProgramming.l No Show Stopper Bugs.l Cross Platform Migration Strategy.

Where to Find More l PHP Homepage: http://www.php.netl PHP-to-MySQL database php3/intro/index.htmll Zend.com: http://www.Zend.com/

History of PHP l1994 - PHP was conceived sometimes in the Fall of 1994 by Rasmus Lerdorf l1995 - PHP/FI Version 2. ( Introducing mySql data base) l1997 – approximately 50,000 web sites. Introducing PHP Version 3. (Zeev Suraski and Andi Gutmans ) l2000 – PHP 4 was introduced, using “Zend ” sc

Related Documents:

PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use What is a PHP File? PHP files can contain text, HTML, CSS, JavaScript, and PHP code PHP code are executed on the server, and the result is returned to the browser .

using MySQL with PHP, Introduction to PHP PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server . PHP

PHP is FREE to download from the official PHP resource: www.php.net PHP is easy to learn and runs efficiently on the server side Where to Start? To get access to a web server with PHP support, you can: Install Apache (or IIS) on your own server, install PHP, and MySQL Or find a web hosting plan with PHP and

php architect's Guide to PHP Design Patterns A Practical Approach to Design Patterns for the PHP 4 and PHP 5 Developer Jason E. Sweat USA 21.99 Canada 29.99 U.K. 16.99 Net php architect's Guide to PHP Design Patterns Design patterns are comprehensive, well-tested solutions to common problems that developers everywhere encounter each day.

Introduction and Basic Syntax Charles Liu . What is PHP? ! PHP PHP: Hypertext Preprocessor ! Server-side scripting language that may be embedded into HTML ! Ultimate goal is to get PHP files to generate client-side code ! must end up with HTML, CSS, JavaScript, other client-side code! Side-by-side PHP File: .

PHP: PHP Hypertext Preprocessor Server-side scripting language PHP pages require a web server with PHP support Competitors: PHP Strengths High performance Interface to many different database systems Built-in libraries Ease of learning and

you can't view your .php page on your local hard drive; you'll either see nothing or see the PHP source code if you upload the file to a PHP-enabled web server, requesting the .php file will run the program and send you back its output 5.2: PHP Basic Syntax 5.1: Server-Side Basics 5.2: PHP Basic Syntax 5.3: Embedded PHP 5.4: Advanced PHP Syntax

Reading music from scratch; Easy, effective finger exercises which require minimal reading ability; Important musical symbols; Your first tunes; Audio links for all tunes and exercises; Key signatures and transposition; Pre scale exercises; Major and minor scales in keyboard and notation view; Chord construction; Chord fingering; Chord charts in keyboard view; Arpeggios in keyboard and .