Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Servlets and Java Server Pages.
Advertisements

PHP I.
Other Web Application Development Technologies. PHP.
E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2.
Lecture plan Information retrieval (from week 11)
PHP for Server-Side Preprocessing Chapter 08. Overview and Objectives Present a brief history of the PHP language Discuss how PHP fits into the overall.
DT228/3 Web Development WWW and Client server model.
Software Freedom Day th September 2007 Asia Pacific Institute of Information Technology Colombo, Sri Lanka. Nazly Ahmed Scripting The Web.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
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.
Servlets and a little bit of Web Services Russell Beale.
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.
DT211/3 Internet Development Application Internet Development Application.
Introduction to Web Based Application. Web-based application TCP/IP (HTTP) protocol Using WWW technology & software Distributed environment.
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.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
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.
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.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
COMP An Introduction to Computer Programming : University of the West Indies COMP6015 An Introduction to Computer Programming Lecture 03.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
UFCEKG-20-2 Data, Schemas & Applications Lecture 4 Server Side Scripting & PHP.
PHP - Hypertext Preprocessor Yaron Benita De Paul University.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Dynamic Web Sites Chris North cs3724: HCI. Presentations matt ketner, sam altman, mike gordon Vote: UI Hall of Fame/Shame?
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
PHP Professor Waterman. Agenda What is PHP Versions HTML Dynamic Web sites Interactive Web Sites Installing PHP Transfer pages to a Web hosting service.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
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.
11/16/2012ISC329 Isabelle Bichindaritz1 Web Database Application Development.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
PHP and MySQL by Example COMP YL Professor Mattos.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Chapter 6 Server-side Programming: Java Servlets
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Interactive Web Tehcnologies Teppo Räisänen LIIKE/OAMK 2011.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
CSC 405: Web Application Engineering II Course Preliminaries Course Objectives Course Objectives Students’ Learning Outcomes Students’ Learning Outcomes.
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.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
Introduction to Dynamic Web Programming
WWW and HTTP King Fahd University of Petroleum & Minerals
Web Development Web Servers.
Web Software Model CS 4640 Programming Languages for Web Applications
PHP / MySQL Introduction
Chapter 27 WWW and HTTP.
Skulbong Taisawapak ID:
IntroductionToPHP Static vs. Dynamic websites
Web Technologies Computing Science Thompson Rivers University
Hypertext Preprocessor
Web Application Development Using PHP
Presentation transcript:

Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction

Sys Prog & Scripting - HW Univ2 Web Dynamic Content A web server responds to static page requests directly by returning the files composing such pages. However dynamic page requests are forwarded to the application server. The business logic required to generate dynamically generated pages is contained in the application server.

Sys Prog & Scripting - HW Univ3 Application Server The application server acts as an interface between the manipulation and presentation of data. –The application server manipulates the system’s data by issuing queries and updates typically to a database in the system. –The presentation of data is achieved by constructing pages containing query results.

Sys Prog & Scripting - HW Univ4 Cont. Application Server Different application server technologies are available including PHP, Asp, Java Servlets and JSP. The application server should provide some form of session tracking to maintain customer information across subsequent requests.

Sys Prog & Scripting - HW Univ5 Role of the Application Server Client Web ServerDatabase Server Application Server Interne t Third Party Services Payments Authorization Etc.

Sys Prog & Scripting - HW Univ6 Application Server Technologies Many programming environments exist for implementing application servers. –Allowing the interaction between front-end databases and fulfilling the need for dynamic HTML page generation. These technologies include: –Common Gateway Interface (CGI) –Active Server Pages (ASP). –ColdFusion. –Java Server Pages (JSP). –Java Servlets. –PHP Hypertext Preprocessor (PHP).

Sys Prog & Scripting - HW Univ7 PHP Overview The PHP Hypertext Preprocessor (PHP) is –an open source, –server-side, –cross-platform, –HTML embedded scripting language. It was developed in 1994 by Rasmus Lerdorf to keep track of visitors to his online C.V. Since then, it has undergone several changes with three major versions released: PHP3, PHP4 and PHP5. PHP originally stood for Personal Home Pages but the name was late changed to PHP Hypertext Preprocessor. As of April 2007, about 21 million domains worldwide use PHP.

Sys Prog & Scripting - HW Univ8 PHP – A Closer Look PHP can be deployed to run as a server-side module in a web server such as Apache. Embedding PHP code into HTML documents enables the generation of HTML code dynamically. PHP borrows concepts of common languages such as C including syntax, datatypes and control structures. PHP supports the object-oriented programming paradigm. Many Web programming features are provided by PHP including form parameter handling and session tracking techniques.

Sys Prog & Scripting - HW Univ9 PHP – A Closer Look (cont'd) Global arrays are created to hold HTTP request details including form parameter and cookies values. These arrays are accessed in the PHP script to fulfill the request. Many relational Database Management Systems (DBMSs) are supported by PHP including MySQL, PostgreSQL and Oracle.

Sys Prog & Scripting - HW Univ10 A Simple PHP Script Hello World Example Hello World '; ?> The following output will be sent to the browser: Hello World Example Hello World

Sys Prog & Scripting - HW Univ11 PHP Global Variables A main feature of the PHP script is the way it handles HTML forms. Form elements will automatically be available to the PHP script when receiving the request. All details about PHP script requests get stored in global variables and can then be accessed by the script, e.g.: –$_GET: a global variable (array) which can be used to get all get request data. –$_POST: a global variable (array) which can be used to get all post request data.

Sys Prog & Scripting - HW Univ12 Example * HTML Form: Your name: Your age: Part of action.php Hi. You are years old. * Introductory tutorial,

Sys Prog & Scripting - HW Univ13 Session Tracking HTTP is a stateless protocol. Web pages are dependent. An application server should provide some form of session tracking to –maintain data across web page requests.

Sys Prog & Scripting - HW Univ14 Session Tracking Mechanisms Different session tracking mechanisms exists including: –Cookies, which is a named piece of data that is provided by the server and stored on the client side. The cookie is added to subsequent client requests to the site, which the server update and send back to the client and so on. –URL Rewriting: in which the necessary session information is encoded into any URLs the server generates. –Another form of session tracking include using an application technology’s built-in session tracking system. –Persistent storage such as a database can be used to store user session information.

Sys Prog & Scripting - HW Univ15 PHP Session Tracking Support PHP supports session tracking using cookies and using a more complex built-in support. For cookies, PHP allows the user to set different parameters in a cookie using the setCookie() method including name, value and expiry date. Cookie details are retrieved using the global variable $_Cookie. PHP also supports a built-in session tracking by providing a unique session ID for every new visitor. The session ID is stored in a cookie called PHPSESSION which is persistent across user requests. Variables can be associated with the session ID and stored in the session’s allocated space.

Sys Prog & Scripting - HW Univ16 Further Reading Rasmus Lerdorf, “Programming in PHP”, O'Reilly, 2006 Luke Welling and Laura Thomson, “PHP and MySQL Web Development”, Sams Publishing, “PHP Tutorial”, “PHP Manual”,