lecture22

lecture22 - PIC 40A Lecture 22 Introduction to PHP What is...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
PIC 40A Lecture 22: Introduction to PHP
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What is PHP? • a server-side scripting language • an interpreted language like JavaScript • developed by Rasmus Lerdorf in 1994 • an open source product
Background image of page 2
What does "PHP" stand for? PHP originally meant P ersonal H ome P age. PHP is now an acronym for P HP: H ypertext P reprocessor
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What is PHP used for? • initially used to help track visitors to Lerdorf’s personal Web site • form handling • database accessing • socket connections between different programs • sending emails or text messages PHP supports email protocols POP3 and IMAP.
Background image of page 4
Where do I put a PHP script? PHP scripts are either • internal – embedded in an XML document • external – in a text file possibly referenced by an XML document Remember: XHTML files are XML documents.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
How does PHP work? When a client requests a document that has embedded PHP, the Web server calls a PHP processor which 1. copies XML code and client-side scripts verbatim to an output document as it finds them 2. interprets the PHP scripts when they occur 3. writes the PHP script output to the output document The Web server then sends the output XHTML document to the client.
Background image of page 6
PHP file stored on the Web server #!/usr/lib/php5/bin/php <?php print('<?xml version = "1.0" encoding="utf-8"?> ');
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/15/2010 for the course PIC 40A taught by Professor Ouellette during the Winter '10 term at UCLA.

Page1 / 21

lecture22 - PIC 40A Lecture 22 Introduction to PHP What is...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online