Other Web Application Development Technologies. PHP.

Slides:



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

E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2.
Other Web Application Development Technologies. PHP.
Overview Environment for Internet database connectivity
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 11: Advanced Web Technologies.
Lecture 11 Server Side Interaction
Lecture plan Information retrieval (from week 11)
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
DT228/3 Web Development WWW and Client server model.
Session 13 Active Server Pages (ASP) Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
Languages for Dynamic Web Documents
Software Freedom Day th September 2007 Asia Pacific Institute of Information Technology Colombo, Sri Lanka. Nazly Ahmed Scripting The Web.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Server-Side vs. Client-Side Scripting Languages
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
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.
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.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
UFCEKG-20-2 Data, Schemas & Applications Lecture 4 Server Side Scripting & PHP.
INTRODUCTION TO WEB DATABASE PROGRAMMING
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
JSP Standard Tag Library
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.

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.
Languages in WEB Presented by: Jenisha Kshatriya BCM SS09.
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.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Website Development with PHP and MySQL Saving Data.
Chapter 6 Server-side Programming: Java Servlets
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Introduction to PHP Advanced Database System Lab no.1.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
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.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
PHP Introduction PHP is a server-side scripting language.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
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.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
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.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
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.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
WWW and HTTP King Fahd University of Petroleum & Minerals
PHP / MySQL Introduction
Web Development Using ASP .NET
Intro to PHP.
Web Application Development Using PHP
Presentation transcript:

Other Web Application Development Technologies

PHP

Personal Home Pages or PHP: Hypertext Preprocessor language for creating HTML content –normally runs as a server-side scripting language –command line scripting possible –client-side GUI applications using PHP- GTK generates other formats –PDF, GIF, JPEG, PNG, Flash

PHP free, open source technology extensive libraries of PHP code modules runs on all major operating systems runs with all major web servers (Apache, IIS, iPlanet) good database integration –MySQL, Oracle, ODBC databases, PostgreSQL, Sybase

PHP example … PHP Hello World Example

PHP architecture

PHP/Web Server Architecture web server layer –handles http requests –passes data to PHP via SAPI TSRM Thread-Safe Resource Management PHP language core PHP API (available to core and PHP extensions) Zend parsing engine –runtime compiler –executer

PHP/Web Server Architecture web server (Apache, IIS, etc..) Server Abstraction API (SAPI) TSRM Zend Engine PHP Core PHP extensions TSRM PHP API

input client HTML page PHP page PHP Zend parsing engine web server data http request output HTML http response PHP and http

form processing example Ice Cream Parlour Flavour : vanilla chocolate Scoops :

form processing example Ice Cream Response Thank you for your order <?php $flavour = $_POST [flavour]; $scoops = $_POST [scoops]; echo $scoops scoops of $flavour coming right up!; ?>

self processing PHP page <?php if(!empty($_POST[name])) { echo Greetings, {$_POST[name]}; } else {?> METHOD=POST> Enter your Name:

control of http response PHP sets standard headers by default –response status line –date, document length –other headers added by web server header () function allows other headers to be set –header (content-type: text/plain); header must be used before any html generated (including leading tag)

cookies $_COOKIE array used for input setcookie () function sets cookie headers in the http response <?php $accesses = $_COOKIE [accesses]; setcookie (accesses, ++$accesses); ?> must be used before html content

sessions PHP provides automatic session handling sessions set up using start_session() command PHP uses cookies to pass session information –will switch to URL-rewriting if cookies disabled start_session() must appear at the start of the PHP document

simple hit counter <?php session_start (); /*a unique session id will be generated and stored in a cookie named PHPSESSID /* session_register (hits); /*sessions can load in variables registered in an associative array called $HTTP_SESSION_VARS*/ ++$hits; //variable is incremented ?> … etc … This page has been viewed times.

PHP and XML

PHP has strong text processing functionality –comprehensive string manipulation –strong regular expressions inherited or imported from Perl full set of filehandling functions for file I/O XML data files can be created/manipulated programmatically using text processing approaches

PHP and XML DOM –DOM processing from PHP 4.3 –DOM extension part of PHP 5 core XSLT –libxslt extension in PHP 5 –A separate XSLT extension available from Sablotron C library (different API)

PHP and XSLT <?php $processor = xslt_create (); $result = xslt_process($processor,source.xml,transform.xml); if(!$result) echo xslt_error ($processor); xslt_free ($processor); echo $result ; ?>

events-based XML programming PHP has an event-based XML parser based on libxml2 library –SAX parser –replaces old non-SAX Expat library parser calls handler functions as events occur you write the event handler functions

PHP strengths and weaknesses

PHP strengths free, open-source product –flexible –extensible easy to implement –builds onto most browsers on most platforms –familiar, flexible and powerful syntax with occasional weirdness thrown in good database connectivity –technology of choice for low-end web-DB system

PHP weaknesses XML support –some non-standard features still in PHP5 slow because of runtime compilation then execution –derives from CGI script origins limited separation of coding from HTML –no equivalent of JSP custom tags –some open source versions emerging see extensibility limited by cumbersome C-based architecture –this is improving with later versions

PHP web application frameworks Frameworks are now emerging for PHP Cake –Next lecture… –growing developer community, growing functionality – Symfony –Very recent but stems from older projects –established development community – Zend Framework –growing community of developers –

PHP web application frameworks Typical functionality CRUD (database interaction) M-V-C architecture Access control lists View helpers - AJAX, JavaScript, etc… Standard application components

Active Server Pages (ASP) Microsoft-based server-side processing technology ASP provides a server-side scripting environment. This includes: Read information from an HTTP request. Customize an HTTP response. Interact with Databases. Support complex middleware.

Active Server Pages (ASP) are processed in response to a client request server-side scripting are processed by an ActiveX component a scripting engine.asphave the file extension.asp contain HTML tags and scripting code VBScript is the most widely used language (although you can use JavaScript, other.NET languages)

The ASP Architecture ASP.DLL

A user makes an http request for an ASP page. The.asp extension tells the Web server that the page contains server script (executable code) that it should process before returning the page to the browser. The server passes the ASP to the scripting engine The scripting engine executes ASP commands as it encounters them After execution of the server scripts, all code is stripped out of the page. The pure HTML page is sent in the http response.

A Simple ASP Example A Simple ASP Example

A Simple ASP Example Simple ASP Example

ASP Built-in Objects Request Response Session Application Server ObjectContext

ASP Built-in Objects Request –Retrieves the values that the browser passes to the server during an HTTP request. Response –Controls what information is sent to a browser in the HTTP response message.

ASP Built-in Objects Session –Used to manage and store information about a particular user session. Application –Used to manage and store information about the Web application.

ASP Built-in Objects Server –Provides access to resources that reside on a server. ObjectContext –Used to commit or abort a transaction managed by Microsoft Transaction Server (MTS) for ASP pages that run in a transaction.

Request Object Collections ClientCertificate Cookies Form QueryString ServerVariables

Form Collection The Form collection contains the values of each standard HTML control that has a NAME attribute. When a user submits a form with the POST method, you can read the values of the controls by using the Form collection. The Form collection of the Request object can be used to extract information from the body of an HTTP request message.

Form Collection Name: Favourite Flavour: Mint Vanilla Coffee

Form Collection icecream.asp Request.Form("name") Request.Form("flavour") or <% For Each Item in Request.Form 'code to display Item here Next %>

ASP on Alternative Platforms Chili!ASP by Chili!Soft (Expensive to buy!) Windows –IIS, Apache, Netscape Enterprise & FastTrack, OReilly WebSite Pro Solaris –Apache, Netscape Enterprise & FastTrack Linux: Apache IBM AIX: Apache, Netscape Enterprise & FastTrack, IBM HTTP Server, Lotus Domino Go HP UX –Apache, Netscape Enterprise

ASP on Alternative Platforms Instant ASP (iASP) by Halcyon Software cheaper written in Java as a Servelet, so runs with Apache/Tomcat and many other servers allows mix of ASP and JSP –better range of functionality –may run slow for high volume applications

ASP Strengths implements M-V-C code embedded in the HTML –separation of concerns no compiling - stays resident in memory no complex interfacing - method calls suitable for high-end web applications standard components –re-use –eases programming effort

ASP weaknesses difficult to port between platforms steep learning curve for full functionality –less suitable for low-end web apps multiplicity of.NET languages –diffuse coding options –can leave legacy problems

ColdFusion

Technology for building dynamic web applications provides powerful markup reducing need for programming skills designed for RAD: abstracts many low- level tasks e.g. connection to a database

ColdFusion runs on all major platforms compatible with all major browsers runs in CGI mode or as an embedded process runs on Apache, IIS, iPlanet ColdFusion applications are portable across platforms with very minor differences

History of ColdFusion developed by Allaire software –first version only 30 language elements –strongly tag-based, supplemented by functions Allaire merged with Macromedia in 2001 –MacroMedia ColdFusion –ColdFusion MX ColdFusion MX 6.1 (2004) –80 tags, 255 functions

use and availability Widely used for medium to large scale web apps Large developer community Not free, not open source –ColdFusion MX Standard £929 Windows, Linux –ColdFusion MX Enterprise £4289 Windows, Linux, Solaris, HP-UX, AIX –30-day free trial version (limited functionality)

ColdFusion Basics

ColdFusion Markup Language tag-based language (CFML) mixed with HTML, JavaScript/VBScript in a template CFML used to dynamically construct content CFML processed by ColdFusion Application Server on the server side

client HTML page CFML template ColdFusion Application Server web server entity data http request input output HTML http response

ColdFusion templates CFML tags embedded in HTML –Can produce pure CFML pages Tag Syntax – content –or trailing / optional –Attributes are literals or expressions –Tags controlled by attributes and/or content

Example 1 Writing output x = #x# y = #y# x * y = #xy#

Example 2 Todays date is #DateFormat (Now (),dd/mm/yy)# CFML tag closing CFML tag

Example 3 <CFMAIL FROM = TO = SUBJECT = "Assessed Lab" SERVER = > Have a Merry Christmas.

ColdFusion Web Application Framework

web application a group of templates forming a cohesive application –maintain state –utilise constants –multi-threading –error and exception handling –security controlled through application template

Application.cfm template reserved template name template placed in root directory of the web application –executed before every request may be supplemented by OnRequestEnd.cfm template –executed after every web request

processing Application templates ColdFusion template requested ColdFusion searches template directory for an Application.cfm template –ColdFusion processes Application.cfm template then requested template –OnRequestEnd.cfm template processed if it exists

template request process client Server myTemplate application template onREquestEnd request response

function of Application.cfm maintains state –create Application, Client and Session variables set application constants –data-source names, source directories, style elements handle errors provide security services –user authentication –entitlements

ColdFusion strengths and weaknesses

strengths tag-oriented programming for web developers –good support for custom tags and extensions full functionality to support medium to high end web systems supports MVC strong support for thread-safe transactions excellent database connectivity implemented on all major platforms

weaknesses expensive compared with other technologies not open source highly redundant syntax –leads to inconsistent development idiosyncratic language structure –limited code re-use on or from other platforms non-standard and limited XML support