Php php hypertext preprocessing
1 / 17

PHP PHP: Hypertext Preprocessing - PowerPoint PPT Presentation

  • Uploaded on

PHP PHP: Hypertext Preprocessing. Matt Murphy & Dublas Portillo. What is PHP?. PHP is a server-side scripting language designed specifically for the Web. An open source language PHP code can be embedded within an HTML page, which will be executed each time that page is visited.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'PHP PHP: Hypertext Preprocessing' - iain

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Php php hypertext preprocessing

PHPPHP: Hypertext Preprocessing

Matt Murphy & Dublas Portillo

What is php
What is PHP?

  • PHP is a server-side scripting language designed specifically for the Web.

  • An open source language

  • PHP code can be embedded within an HTML page, which will be executed each time that page is visited.

  • Example code (all equivalent):

    • Short Style: <? echo “Hello World!”; ?>

    • XML Style: <?php echo “Hello World!”; ?>

    • Script Style: <SCRIPT LANGUAGE=‘php’> echo “Hello World!”; </SCRIPT>

    • ASP Style: <% echo “Hello World!”; %>

History of php
History of PHP

  • Created by Rasmus Lerdorf in 1994

  • Originally a set of Perl scripts used by Lerdorf to show off his résumé as well as collect information on his website, such as the site’s traffic info.

  • Lerdorf later transcribed these Perl scripts into a set of CGI binaries written in C, and in doing so, combined it with his own Form Interpreter to create PHP/FI.

History of php1
History of PHP

  • PHP/FI grew in popularity, but did not become widely known until two program developers named Zeev Suraski and Andi Gutmans, developed a new parser in the summer of 1997, which led to the development of PHP 3.0.

  • The newest version out is PHP 5, which uses an engine developed by Suraski and Gutmans, known as the Zend II Engine. (Zend I was used by PHP 4)

Php programming paradigms
PHP Programming Paradigms

  • Uses both procedural and object oriented paradigms

  • Procedural PHP

    • Has been in use since the creation of PHP, its primary paradigm.

    • Allows for easy and quick learning of the PHP language.

    • Similar to other popular languages such as Visual Basic, C++, and Fortran.

Php programming paradigms1
PHP Programming Paradigms

  • Object Oriented PHP

    • Similar to Java, example of an object class:

Features of php
Features of PHP

  • Very Efficient – Can serve millions of hits per day.

  • Database Integration – Supports many databases, such as mySQL and Oracle. Also has excellent XML support as of PHP 5.

  • Built-in Libraries – Tailored to web development, one can connect to other network services, send email, work with cookies, generate PDF documents, and make GIF images on the fly all with a few lines of code.

  • It’s Free – Available on

  • Easy to Learn – Very similar in syntax to C/C++/Java and Perl.

  • Portable – Works on Unix based operating systems, on Mac OS X, as well as on versions of Microsoft Windows. Your PHP code will often work without modification on a different system running PHP.

Database support
Database Support

  • The following is a list of supported databases in PHP 5:

Differences from java
Differences From Java

  • Data types are not required in variable declarations.

  • The $ symbol precedes all variables in PHP

  • Constants are declared using the define() method in PHP: ex. define(“AOL", "something");

  • Constructors do not necessarily have to be the same name as the class name.

  • Destructors are used in PHP to remove objects from memory after they are constructed.

What is php good for
What is PHP Good For?

  • It is great for complex web page designs

    • E-commerce sites with heavy traffic (ex. Amazon)

    • Complex bulletin boards and forums (ex. phpBB)

    • Secure websites (ex. Novasis)

    • Email web hosts (ex. Gmail)

    • Working with and integrating XML into your webpage

    • Database management and search (ex. theFaceBook)

Getting started
Getting Started

  • Download Apache 2 Windows Binary (MSI installer) at

    • The zip must end with win32-x86-no_ssl.msi

  • Download the PHP zip package at

    • Download the zip pack, not the installer

  • Install Apache 2, use recommended settings

    • If error message is given, go here (Google port 80 problem):

  • Unzip PHP file to C:\PHP

Getting started1
Getting Started

  • Next, copy/paste "php.ini-dist" to C:/Program Files/Apache Group/Apache2, and rename it to php.ini.

  • Copy the following list of .dll files from your C:\PHP and C:\PHP\ext directory to your root Apache directory (where you put php.ini):

    • fdftk.dll fribidi.dll gds32.dll libeay32.dll libmash.dll libmysql.dll libmysqli.dll msql.dll ntwdblib.dll php5apache2.dll php5apache.dll php5apache_hooks.dll php5isapi.dll php5nsapi.dll php5ts.dll phpmsql.dll phpmssql.dll phpmysql.dll phpmysqli.dll ssleay32.dll yas.dll

Getting started2
Getting Started

  • Set the PHP path for Windows: Go to: Control Panel > System > Advanced tab Click on "Environment variables" Look in the "System variables" pane Find the "Path" entry Double click it and add at the end of the string your PHP dir You need to start with ";" without double quotes! And follow by: C:php So it will look like: ";C:php" Again, without double quotes! Now restart the Apache server. Test: Create a simple file (using notepad) such as php5_info.php <? phpinfo();?>

  • Save it in C:/Program Files/Apache Group/Apache2/htdocs/php5_info.php Open a browser and enter the following address http://localhost/php5_info.php it should display your complete PHP setting if it does not work properly you might have done something wrong with the multiple edits; check them out and give it another go.

  • Now you can use any text editor or html editor to create PHP files

An example
An Example

  • titleCreator.php

    • Uses a simple form with simple fields

    • Asks a user for input, such as the title they want, what their name is, the background color, etc.

    • When submitted, the page is reloaded with the specified form values using PHP code to write out new HTML code

Useful links
Useful Links

  • Official Website (

  • PHP Online Manual (

  • Installation on Windows Systems (

  • Using Apache with Windows (

  • Alternative Installation Guide (