PHP PHP: Hypertext Preprocessing Matt Murphy & Dublas Portillo.

Slides:



Advertisements
Similar presentations
IS 6116 Introduction – 10 Jan Lecturer Details Aonghus Sugrue Website: aonghussugrue.wordpress.com
Advertisements

Software Freedom Day th September 2007 Asia Pacific Institute of Information Technology Colombo, Sri Lanka. Nazly Ahmed Scripting The Web.
PHP: Hypertext Preprocessor Greg Lowe Rob White Brian Wright Mike Zywiec.
BY: ALBERTO CABEZAS 4/19/2010. INTRODUCTION: PHP is considered today as one of the most famous scripting languages. PHP is widely used as a general purpose.
Server-Side vs. Client-Side Scripting Languages
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
By Brian Patterson & Amanda Perez. PHP was originally created to maintain his personal homepage, hence the name PHP. Development began in 1994 and was.
May 11, 2011 PHP Hypertext Preprocessor. What is the technology? ✤ Server side scripting and programming language. ✤ Can be embedded in HTML ✤ Free and.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Website Development with PHP and MySQL Introduction.
Guide To UNIX Using Linux Third Edition
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
Mgt 240 Lecture Website Construction: Software and Language Alternatives March 29, 2005.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
PHP By Dr. Syed Noman Hasany. PHP PHP was originally created by Rasmus Lerdorf in PHP stands for PHP: Hypertext Preprocessor (a recursive acronym).
PHP PHP: Hypertext Preprocessing. What is PHP? PHP is a server-side scripting language designed specifically for the Web. An open source language PHP.
Web Page A page displayed by the browser. Website Collection of multiple web pages Web Browser: A software that displays web pages on client computer.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application.
Powerpoint Templates Page 1 Powerpoint Templates Web Programming PHP MySql Ikbal Jamaludin.
What is PHP PHP (officially "PHP: Hypertext Preprocessor") is a server-side HTML-embedded scripting language –means that code does not need to be compiled.
PHP - Hypertext Preprocessor Yaron Benita De Paul University.
ITD 3194 Web Application Development Chapter 4: Web Programming Language.

Languages in WEB Presented by: Jenisha Kshatriya BCM SS09.
PHP was created by Rasmus Lerdorf in It was initially server-side, traffic tracking script. PHP 2 (1995) Added database support, file uploads, regular.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
PHP Professor Waterman. Agenda What is PHP Versions HTML Dynamic Web sites Interactive Web Sites Installing PHP Transfer pages to a Web hosting service.
INTERNET APPLICATION DEVELOPMENT For More visit:
PHP PHP: Hypertext Preprocessing Preston Brinks and Sean McKenzie.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Apache, MySQL and PHP Installation and Configuration Chapter 3 PHP Installation and Configuration.
Technical Review - PHP Jang Jaeseok. Overview Introduction  What is PHP?  History of PHP  What can do with PHP?  Advantages of PHP PHP syntax.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Installation and Testing.
Introduction to PHP and MySQL Kirkwood Center for Continuing Education By Fred McClurg, © Copyright 2015, Fred McClurg, All Rights.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
WEB DEVELOPMENT WITH PHP/MYSQL. WEB DEVELOPMENT COURSE HAS DIFFERENT NAME IN DIFFERENT INSITUTES, THIS IS A CORE COURSE FOR BS/MS STUDENTS. THIS IS ALSO.
Yasar Hussain Malik - NISTE. PHP Origins Rasmus Lerdorf PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP Hypertext Processor’ Other key.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
PHP Introduction PHP is a server-side scripting language.
1 PHP Pattadon Sintusak ID PHP Programmingintroduction2 Content History of PHP What’s PHP? Purpose of PHP Structure of PHP Language Reference.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
PHP Form Processing * referenced from
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
PHP stands for …….. “PHP Hypertext Pre-processor” and is a server-side scripting language like ASP. PHP scripts are executed on the server PHP supports.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
Introduction to PHP and MySQL – Creating Database-Driven Websites
Introduction to PHP “PHP is a server-side scripting language designed specifically for the Web. Within an HTML page, you can embed PHP code that will be.
Introduction to PHP “PHP is a server-side scripting language designed specifically for the Web. Within an HTML page, you can embed PHP code that will be.
PHP / MySQL Introduction
IntroductionToPHP Static vs. Dynamic websites
Intro to PHP.
Web Application Development Using PHP
Presentation transcript:

PHP PHP: Hypertext Preprocessing Matt Murphy & Dublas Portillo

What is PHP? PHP is a server-side scripting language designed specifically for the Web. PHP is a server-side scripting language designed specifically for the Web. An open source language An open source language PHP code can be embedded within an HTML page, which will be executed each time that page is visited. PHP code can be embedded within an HTML page, which will be executed each time that page is visited. Example code (all equivalent): Example code (all equivalent): Short Style: Short Style: XML Style: XML Style: Script Style: echo “Hello World!”; Script Style: echo “Hello World!”; ASP Style: ASP Style:

History of PHP Created by Rasmus Lerdorf in 1994 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. 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. 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 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. 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) 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 Uses both procedural and object oriented paradigms Uses both procedural and object oriented paradigms Procedural PHP Procedural PHP Has been in use since the creation of PHP, its primary paradigm. Has been in use since the creation of PHP, its primary paradigm. Allows for easy and quick learning of the PHP language. Allows for easy and quick learning of the PHP language. Similar to other popular languages such as Visual Basic, C++, and Fortran. Similar to other popular languages such as Visual Basic, C++, and Fortran.

PHP Programming Paradigms Object Oriented PHP Object Oriented PHP Similar to Java, example of an object class: Similar to Java, example of an object class: <?php class BaseClass { function __construct() { function __construct() { echo "In BaseClass constructor "; echo "In BaseClass constructor "; }} class SubClass extends BaseClass { function __construct() { function __construct() { parent::__construct(); parent::__construct(); echo "In SubClass constructor "; echo "In SubClass constructor "; }} $obj = new BaseClass(); $obj = new SubClass(); ?> public class BaseClass { public BaseClass() { public BaseClass() { System.out.println("In BaseClass constructor\n"); }} class SubClass extends BaseClass { public SubClass() { public SubClass() {super(); System.out.println("In SubClass constructor\n"); }} public class Output { public static void main(String[] args) { public static void main(String[] args) { Object obj; obj = new BaseClass(); obj = new SubClass(); }}

Features of PHP Very Efficient – Can serve millions of hits per day. 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. 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 , work with cookies, generate PDF documents, and make GIF images on the fly all with a few lines of code. Built-in Libraries – Tailored to web development, one can connect to other network services, send , 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 It’s Free – Available on Easy to Learn – Very similar in syntax to C/C++/Java and Perl. 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. 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 The following is a list of supported databases in PHP 5: The following is a list of supported databases in PHP 5: Adabas D InterBase PostgreSQL dBase FrontBase SQLite Empress mSQL mSQL FilePro (read-only) Solid Direct MS-SQL SybaseHyperwaveMySQLVelocisODBC Unix dbm Informix Oracle (OCI7 and OCI8) IngresOvrimos IBM DB2

Differences From Java Data types are not required in variable declarations. Data types are not required in variable declarations. The $ symbol precedes all variables in PHP The $ symbol precedes all variables in PHP Constants are declared using the define() method in PHP: ex. define(“AOL", "something"); 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. 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. Destructors are used in PHP to remove objects from memory after they are constructed.

What is PHP Good For? It is great for complex web page designs It is great for complex web page designs E-commerce sites with heavy traffic (ex. Amazon) E-commerce sites with heavy traffic (ex. Amazon) Complex bulletin boards and forums (ex. phpBB) Complex bulletin boards and forums (ex. phpBB) Secure websites (ex. Novasis) Secure websites (ex. Novasis) web hosts (ex. Gmail) Working with and integrating XML into your webpage Working with and integrating XML into your webpage Database management and search (ex. theFaceBook) Database management and search (ex. theFaceBook)

Processing a PHP Page

Getting Started Download Apache 2 Windows Binary (MSI installer) at Download Apache 2 Windows Binary (MSI installer) at The zip must end with win32-x86-no_ssl.msi The zip must end with win32-x86-no_ssl.msi Download the PHP zip package at Download the PHP zip package at Download the zip pack, not the installer Download the zip pack, not the installer Install Apache 2, use recommended settings Install Apache 2, use recommended settings If error message is given, go here (Google port 80 problem): If error message is given, go here (Google port 80 problem): Unzip PHP file to C:\PHP Unzip PHP file to C:\PHP

Getting Started Next, copy/paste "php.ini-dist" to C:/Program Files/Apache Group/Apache2, and rename it to php.ini. 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): 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 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 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 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 Save it in C:/Program Files/Apache Group/Apache2/htdocs/php5_info.php Open a browser and enter the following address 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. Save it in C:/Program Files/Apache Group/Apache2/htdocs/php5_info.php Open a browser and enter the following address 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 Now you can use any text editor or html editor to create PHP files

An Example titleCreator.php titleCreator.php Uses a simple form with simple fields 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. 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 When submitted, the page is reloaded with the specified form values using PHP code to write out new HTML code

titleCreator.php

Useful Links Official Website ( ) Official Website ( ) PHP Online Manual ( ) PHP Online Manual ( ) Installation on Windows Systems ( ) Installation on Windows Systems ( ) Using Apache with Windows ( ) Using Apache with Windows ( ) Alternative Installation Guide ( ) Alternative Installation Guide ( )