PHP Presented by Christine Fang and Ian Stuart ● CS616 Spring 2003.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
Page 1 PHP, HTML, STATE Achmad Arwan, S.Kom. Page 2 PHP ( PHP: Hypertext Preprocessor) A programming language devised by Rasmus Lerdorf in 1994 for building.
Server-Side vs. Client-Side Scripting Languages
PHP CSCE 330 February 6, 2003 Group Members: Antwan B. Phan George Hwang Luat Vu Programming Language Presentation.
Website Development Introducing PHP The PHP scripting language Syntax derives from C, Java and Perl Open Source Links to MySql database.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Guide To UNIX Using Linux Third Edition
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
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).
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
PHP Workshop ‹#› PHP: The Basics. PHP Workshop ‹#› What is it? PHP is a scripting language commonly used on web servers. –Stands for “PHP: Hypertext Preprocessor”
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Introduction to PHP. PHP PHP is the Hypertext Pre-processor –Script language –Embedded into HTML –Runs as Apache module –Can use DB (MySQL, Oracle, Microsoft.
August Chapter 1 - Essential PHP spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
ALBERT WAVERING BOBBY SENG. Week Whatever: PHP  Announcements/questions/complaints.
UFCEKG-20-2 Data, Schemas & Applications Lecture 4 Server Side Scripting & PHP.
NMD202 Web Scripting Week1. Contact Information – Lecturer is a part time member of staff. Students are encouraged to use.
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.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Mandakini Ayushi Infotech Mandakini Kumari 22 nd July PHP Basic.
PHP - Hypertext Preprocessor. Introduction PHP is a powerful server-side scripting language for creating dynamic and interactive websites. PHP is a powerful.
SCV1223 PHP - Hypertext Preprocessor. Introduction PHP is a powerful server-side scripting language for creating dynamic and interactive websites. PHP.
Languages in WEB Presented by: Jenisha Kshatriya BCM SS09.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
COP 3813 Intro to Internet Computing Prof. Roy Levow PHP.
Nael Alian Introduction to PHP
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
November 2003Bent Thomsen - FIT 6-11 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Open Source Software Unit – 3 Presented By Mr. R.Aravindhan.
Website Development with PHP and MySQL Saving Data.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Overview: 1. Discussion of the basic architecture of a web application. 2. Discussion of the relevance of using MySQL and PHP in a web application.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
PHP. What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server.
Introduction to PHP Advanced Database System Lab no.1.
What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports.
Week 4 PHP H ypertext P reprocessor Reference : Official Site :
CSE 154 LECTURE 5: INTRO TO PHP. URLs and web servers usually when you type a URL in your browser: your computer looks up the.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
Introduction to PHP.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
IT ELECTIVE 2.  Web server Can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
PHP Introduction PHP is a server-side scripting language.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
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.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
CGS 3066: Web Programming and Design Spring 2016 PHP.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 13 Scott Marino.
1 Server Side scripting PHP. 2 What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
A pache M ySQL P hp Robert Mudge Reference:
PHP using MySQL Database for Web Development (part II)
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
PHP (PHP: Hypertext Preprocessor)
PHP / MySQL Introduction
PHP.
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
IntroductionToPHP Static vs. Dynamic websites
PHP: Hypertext Preprocessor
PHP an introduction.
Presentation transcript:

PHP Presented by Christine Fang and Ian Stuart ● CS616 Spring 2003

PHP - the “PHP Hypertext Preprocessor” It’s an open-source programming language for building dynamic, interactive web sites. Devised by Rasmus Lerdorf in PHP is a project of the Apache Foundation. In technical terms, PHP is a cross-platform, HTML-embedded, server-side web scripting language. What is PHP?

The code is written in files containing a mixture of PHP instructions and HTML code. PHP between Programs run on a web servers and return HTML code readable by any browser. No client-side plug-ins are required. How does it work?

Web Server/Browser Interact with PHP

PHP can be used to write the web sites which anyone familiar with the Web uses every day: e-commerce sites, search engines, etc. Allows custom pages for clients Supports back-end database connectivity What can we do with PHP?

Server software A PHP compatible web server PHP4 A relational database system Client software A web browser A text editor, such as Notepad, Emacs, vi, BBEdit, and so on. What software do we need?

Like HTML, PHP variables are not strongly typed: they don’t need to be cast by the programmer. String (text) integer (numeric) double (numeric) array object Data Types

<?php $myClass = “CS616”; echo “Welcome to $myClass”; ?> A Very Simple Example

GET method and POST method Most common HTML form controls: text boxes, checkboxes, radio buttons, listboxes, hidden fields, passwords and buttons. The ACTION attribute is used to specify which page we go to once the form is submitted. The.php file suffix indicates that the page is sent to the PHP script engine. Handling HTML Forms

Numerically-Indexed Arrays Associative (String-Indexed) Arrays $treeMember["YearOfBirth"] = 1913; Non-Sequential Arrays $employeeNames[268] = "Fang"; $employeeNames[145] = "Stuart"; Multidimensional Arrays PHP: Arrays

Conditional/Branching Statements –if / else / else if –switch / case Loops and iterations –while and do/while –for and foreach loops –list and each functions PHP Control Structures

foreach ($myArray As $myArrayElement) { …iterate through each $myArrayElement } foreach ($myArray As $myArrayIndex => $myArrayElement) { …iterate through each $myArrayIndex that corresponds to each $myArrayElement } PHP: foreach Loops

Useful for iterating through associative and nonsequential arrays: while (list($index, $elementData) = each($theArray)) { …iterate through the array, with access to the indices and elements } PHP: list and each Functions

PHP “modules” are functions –Pass variables by value or by reference –No function overloading, but default values for parameters can be defined “Include” files –Simple import of code from other files –Works within conditional constructs Limited support for objects Modularization and OO Support

PHP was not originally intended to be OO Now supports classes –Class and instance variables –Inheritance (subclasses) –Limited polymorphism (no overriding) Objects can be serialized/deserialized (example: session management) PHP Objects

Allow pattern recognition in data Similar notation to Perl or Python Convenient for string manipulation: –Escaping special characters (i.e. backslashes) –Parsing and matching text –Data verification (URLs, , passwords) Regular Expressions in PHP

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP Huh…?

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP The string $the Address must begin with a block of text Containing alphanumeric characters (A to Z, a to z, 0-9)…

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP …followed by zero or more blocks of text that must start with a period and then at least one alphanumeric character…

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP …followed by symbol…

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP …followed by one or more blocks of text using the same patterns used before (the server/domain names)…

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP …followed by a block of text that must begin with a period and then consist of at least two letters (the domain suffix).

$valid = eregi ( "[a-z0-9]+([\.][a-z0-9]+)*". "\.[a-z]{2,}", $the Address); Regular Expressions in PHP If the pattern matches, $valid equals true; otherwise it’s false. (In reality, we’d also check for characters like underscores and hyphens.)

PHP provides connectivity for several database systems and sources, including (in part): –Unified ODBC –Microsoft SQL Server –MySQL –Oracle –Sybase –Informix PHP and Databases

PHP doesn’t require client-side capabilities besides an HTML-enabled browser. PHP requires less communication overhead than Java and JSP. PHP lacks some features like custom tags and JavaBeans. Better OO in Java and JSP PHP vs. Java and JSP

Consider Java/JSP for larger projects requiring reusable modules and large libraries. Consider PHP when processing performance is a primary concern, or when rapid application development is needed. PHP vs. Java and JSP

PHP uses a C-like syntax; ASP is driven by VBScript. ASP is generally slower due to overhead; PHP uses its own memory space. PHP is open source (read: free) while ASP is a proprietary commercial product. PHP vs. ASP

Revised Alta Vista results, March 6, Source: Market Share

Revised Alta Vista results, March 6, Source:

The official PHP site: PHP Builder: PHP Developer’s Network: PHPFreaks.com: Codewalkers.com: PHP Resources