Developing Web Applications with PHP

Slides:



Advertisements
Similar presentations
PHP Hypertext Pre-Processor
Advertisements

Developing Web Applications with PHP RAD for the World Wide Web Jeff Jirsa
PHP I.
1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
INTRODUCTION GROUP MEMBERS Abubakr Saeed : Khurram Ali Khan :
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.
PHP/ASP Robert Nelson & Will Vanlue BA370 November 4 th, 2005.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
May 11, 2011 PHP Hypertext Preprocessor. What is the technology? ✤ Server side scripting and programming language. ✤ Can be embedded in HTML ✤ Free and.
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.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
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 Matt Murphy & Dublas Portillo.
PHP PHP: Hypertext Preprocessing. What is PHP? PHP is a server-side scripting language designed specifically for the Web. An open source language PHP.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
COMP An Introduction to Computer Programming : University of the West Indies COMP6015 An Introduction to Computer Programming Lecture 03.
UFCEKG-20-2 Data, Schemas & Applications Lecture 4 Server Side Scripting & PHP.
PHP HYPERTEXT: PREPROCESSOR By: Justin T. Pleva. WHAT IS PHP?  General purpose  Server-side web development  Console application.
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.
Script Programming Sutep JUNKHIAW
ITD 3194 Web Application Development Chapter 4: Web Programming Language.

PHP was created by Rasmus Lerdorf in It was initially server-side, traffic tracking script. PHP 2 (1995) Added database support, file uploads, regular.
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.
Nael Alian Introduction to PHP
Technical Review - PHP Jang Jaeseok. Overview Introduction  What is PHP?  History of PHP  What can do with PHP?  Advantages of PHP PHP syntax.
Introduction to ColdFusion Yu Fu 2003 MEC Candidate.
Developing Web Applications with PHP RAD for the World Wide Web.
Introduction to PHP and MySQL Kirkwood Center for Continuing Education By Fred McClurg, © Copyright 2015, Fred McClurg, All Rights.
Open Source Software Unit – 3 Presented By Mr. R.Aravindhan.
PHP OVERVIEW. C ONTENT Introduction of PHP History and development Basics of PHP programming.
Introduction to CS520/CS596_026 Lecture Two Gordon Tian Fall 2015.
CS320 Web and Internet Programming Introduction to PHP Chengyu Sun California State University, Los Angeles.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
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.
1Introduction to PHP 5 Presented by Brett Buddin.
PHP OVERVIEW. C ONTENT Introduction of PHP History and development Basics of PHP programming.
1 PHP Pattadon Sintusak ID PHP Programmingintroduction2 Content History of PHP What’s PHP? Purpose of PHP Structure of PHP Language Reference.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
PHP Training With Live SSDN Technologies SSDN Technologies To request free demo session please mail us at or call us at
By bscshelp.com 1.  It is a group assignment.  Complete Website design Using Html and Css.  Due date: 10 th December, 2014 (Hard Deadline) 2.
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 Programming Language. PHP is a server-side scripting language designed for web development but also used as a general- purpose programming language.
Presenting By A-ONE INFOTECH.  A-one InfoTech is a professional web design company located in Chandigarh, India. We specialized in web design, web development,
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
PHP using MySQL Database for Web Development (part II)
Introduction to PHP and MySQL – Creating Database-Driven Websites
Introduction to Dynamic Web Programming
And Why You Should Use It In You 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
PHP Introduction.
Skulbong Taisawapak ID:
PHP.
IntroductionToPHP Static vs. Dynamic websites
Introduction to PHP.
PHP: Hypertext Preprocessor
Presentation transcript:

Developing Web Applications with PHP * 07/16/96 Developing Web Applications with PHP RAD for the World Wide Web Jeff Jirsa jjirsa@xnet.com *

Agenda Introduction PHP Language Basics Built-in Functions * 07/16/96 Agenda Introduction PHP Language Basics Built-in Functions PHP on Linux and Windows Tricks and Tips PHP 5 Examples Questions? *

Introduction What is PHP? PHP stands for "PHP Hypertext Preprocessor” An embedded scripting language for HTML like ASP or JSP A language that combines elements of Perl, C, and Java

Introduction History of PHP Created by Rasmus Lerdorf in 1995 for tracking access to his resume Originally a set of Perl scripts known as the “Personal Home Page” tools Rewritten in C with database functionality Added a forms interpreter and released as PHP/FI: includes Perl-like variables, and HTML embedded syntax

Introduction History of PHP (cont.) Rewritten again in and released as version 2.0 in November of 1997 Estimated user base in 1997 is several thousand users and 50,000 web sites served Rewritten again in late 1997 by Andi Gutmans and Zeev Suraski More functionality added, database support, protocols and APIs

Introduction History of PHP (cont.) User base in 1998 estimated 10,000 users and 100,000 web sites installed Version 3.0 was released in June 1998 as PHP Estimated user base in tens of thousands and hundreds of thousands of web sites served

Introduction History of PHP (cont.) Rewritten again in 1997 by Andi Gutmans and Zeev Suraski More functionality added (OOP features), database support, protocols and APIs PHP 3.0 is released in June 1998 with some OO capability The core is rewritten in 1998 for improved performance of complex applications

Introduction History of PHP (cont.) The core is rewritten in 1998 by Zeev and Andi and dubbed the “Zend Engine” The engine is introduced in mid 1999 and is released with version 4.0 in May of 2000 The estimated user base is hundreds of thousands of developers and several million of web sites served

Introduction History of PHP (cont.) Version 5.0 will include version 2.0 of the Zend Engine New object model is more powerful and intuitive Objects will no longer be passed by value; they now will be passed by reference Increases performance and makes OOP more attractive

Introduction Netcraft Statistics 11,869,645 Domains, 1,316,288 IP Addresses

Introduction Performance* Zdnet Statistics PHP pumped out about 47 pages/second Microsoft ASP pumped out about 43 pages/second Allaire ColdFusion pumped out about 29 pages/second Sun Java JSP pumped out about 13 pages/second * From PHP HOWTO, July 2001

PHP Language Basics The Script Tags All PHP code is contained in one of several script tags: <? // Some code ?> <?php // Some code here ?>

PHP Language Basics The Script Tags (cont.) ASP-style tags <script language=“PHP"> // Some code here </script> ASP-style tags Introduced in 3.0; may be removed in the future <% // Some code here %>

PHP Language Basics The Script Tags (cont.) “Echo” Tags <table> <tr> <td>Name:</td><td><?= $name ?></td> </tr> <tr> <td>Address:</td><td><?= $address ?></td> </tr> </table>

PHP Language Basics Hello World!: An Example Like Perl, there is more than one way to do it <?php echo “Hello World!”; ?> <?php $greeting = “Hello World!” printf(“%s”, $greeting); php?>

PHP Language Basics Hello World!: An Example (cont.) <script language=“PHP”> $hello = “Hello”; $world = “World!”; print $hello . $world </script>

PHP Language Basics Constants, Data Types and Variables Constants define a string or numeric value Constants do not begin with a dollar sign Examples: define(“COMPANY”, “Acme Enterprises”); define(“YELLOW”, “#FFFF00”); define(“PI”, 3.14); define(“NL”, “<br>\n”);

PHP Language Basics Constants, Data Types and Variables Using a constant print(“Company name: “ . COMPANY . NL);

PHP Language Basics Constants, Data Types and Variables Data types Integers, doubles and strings isValid = true; // Boolean 25 // Integer 3.14 // Double ‘Four’ // String “Total value” // Another string

PHP Language Basics Constants, Data Types and Variables Data types Strings and type conversion $street = 123; $street = $street . “ Main Street”; $city = ‘Naperville’; $state = ‘IL’; $address = $street; $address = $address . NL . “$city, $state”; $number = $address + 1; // $number equals 124

PHP Language Basics Constants, Data Types and Variables Data types Arrays Perl-like syntax $arr = array("foo" => "bar", 12 => true); same as $arr[“foo”] = “bar”; $arr[12] = true;

PHP Language Basics Constants, Data Types and Variables Arrays (cont.) <?php $arr = array("somearray" => array(6 => 5, 13 => 9, "a" => 42)); echo $arr["somearray"][6]; // 5 echo $arr["somearray"][13]; // 9 echo $arr["somearray"]["a"]; // 42 ?>

PHP Language Basics Constants, Data Types and Variables Objects Currently not much more advanced than than associative arrays Using constants Before version 5.0, objects are passed by value Slow Functions can not easily change object variables

PHP Language Basics Constants, Data Types and Variables Operators Contains all of the operators like in C and Perl (even the ternary) Statements if, if/elseif Switch/case for, while, and do/while loops Include and require statements for code reuse

Built-in Functions What comes In the box? Array Manipulator Functions sort, merge, push, pop, slice, splice, keys, count CCVS: Interface to Red Hat’s credit system COM functions: Interface to Windows COM objects Date and Time Functions getdate, mkdate, date, gettimeofday, localtime, strtotime, time

Built-in Functions What comes In the box? Directory Functions Platform independent Error Handling Functions Recover from warnings and errors Filesystem Functions Access flat files Check directory, link, and file status information Copy, delete, and rename files

Built-in Functions What comes In the box? IMAP Functions Manipulate mail boxes via the IMAP protocol LDAP Functions Works with most LDAP servers Mail Functions mail($recipient, $subject, $message)

Built-in Functions What comes In the box? Database Functions dba: dbm-style abstraction layer dBase Frontbase Informix Ingres II Interbase mSQL

Built-in Functions What comes In the box? Database Functions (cont.) MySQL Oracle PostgreSQL SQL Server MING Macromedia Flash PDF Create/manipulate PDF files dynamically

Built-in Functions What comes In the box? POSIX Functions Manipulate process information Regular Expression Functions Uses POSIX regex Semaphore and Socket Functions Available only on Unix Session Management Functions

PHP on Linux and Windows Code Portability The obvious: don’t use Unix or Windows specific functions Create a reusable module for file system differences, for example: if( PHP_OS == "Linux" ) { $ConfigPath = "/var/www/conf"; $DataPath = "/var/www/data"; }

PHP on Linux and Windows Code Portability if( ereg("WIN", PHP_OS) ) { $ApachePath = “C:/Program Files/Apache Group/Apache”; $ConfigPath = ”$ApachePath/htdocs/conf"; $DataPath = "$ApachePath/htdocs/data"; } $ConfigFile = "$ConfigPath/paperwork.conf"; $CountryList = "$DataPath/countries.txt"; $StateAbbrList = "$DataPath/usstateabbrs.txt"; $StateNameList = "$DataPath/usstatenames.txt";

Tricks and Tips Coding Prototype your web pages first Separate the design of the site from the coding Turn repetitive code into functions Makes for more maintainable and reusable code Turn grunt code into functions Database access, configuration file access

Tricks and Tips Debugging Feature: PHP is not a strongly typed language Variables can be created anywhere in your code Undocumented Feature: PHP is not a strongly typed language Typos in variable names will cause stuff to happen

Tricks and Tips Debugging Use scripts to dump form and session variables Write scripts to dump data to discover bad or missing data

Tricks and Tips Development Tools Color coding editors IDEs vim, Emacs, Visual SlickEdit IDEs Windows Macromedia Dreamweaver Allaire Homesite Zend’s PHPEdit Linux ???

PHP 5 Release Date Features ??? Complete objects Objects with constructors Abstract classes Private, protected and abstract functions Private, protected and constant variables Namespaces Exception handling with try/catch blocks

Resources PHP Downloads and Online Documentation Community Newsgroups www.php.net Community www.phpbuilder.com: articles on PHP, discussion forums www.phpresourceindex.com: over 1,000 PHP scripts www.phpvolcano.com: PHP 5 information Newsgroups comp.lang.php

Questions? Any Questions Community Newsgroups www.php.net www.phpbuilder.com: articles on PHP, discussion forums Newsgroups comp.lang.php