php/asp robert nelson & will vanlue ba370 november 4 th, 2005

16
PHP/ASP PHP/ASP Robert Nelson & Will Vanlue BA370 November 4 th , 2005

Post on 19-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

PHP/ASPPHP/ASP

Robert Nelson & Will VanlueBA370

November 4th, 2005

Server Side Processing Server Side Processing (SSP)(SSP)

• HTTP is a stateless protocol– How do we overcome this? With SSP

• Server Side Processing Definition:– Coding that is placed in served files, and evaluated on the server

while the files are being served to the client. They let you add dynamically generated content to an existing file (usually HTML

pages). • With SSP, we are able to “remember”

previous activity from internet clients• SSP has many other functions too.

Server Side Processing Server Side Processing (SSP)(SSP)

• Languages and technologies that allow for dynamic content in web pages

• Call allow for the inclusion of time, connection, geographic, or browser –dependent information

• Online shopping, personalized content, developing directories, and other non-static applications require SSP

Server Side Processing Server Side Processing (SSP)(SSP)

• Many technologies used to implement SSP– ASP, PHP, JSP, Coldfusion, ASP.NET, Java, Perl,

Python, C#, etc.

• Why PHP/ASP?– Very widely used languages– Both have relatively low learning curves– Large support communities

• http://www.php.net• http://msdn.microsoft.com

Server Side ProcessingServer Side Processing

1

Client Server

Other Requests

(servers, database apps, etc.)

1. Client requests a page from the server

2. HTTP Server passes PHP/ASP page to interpreter application.

3. Interpreter parses code and returns it to HTTP server as HTML.

4. Page is delivered back to client as HTML.

4

Interpreter (PHP, ASP)

2

3

History of PHPHistory of PHP• PHP/FI (1995)

– “Personal Home Page/Forms Interpreter”– Created by Rasmus Lerdorf– Sample set of Perl scripts to track online access to documents– Relatively inconsistent syntax– Lerdorf chose to publicly release the source code

• PHP/FI 2.0 (1997)– “Cult” like following of thousands of users– Approximately 50,000 pages (1% of the internet) report usage– Spent most of it’s life in beta

• PHP 3.0 (1998)– Recursive Acronym: PHP: Hypertext Preprocessor– First version to resemble modern PHP– Created by Andi Gutmans and Zeev Suraski with help from Lerdorf– Name was changed to make it sound more useful for commercial usage– Object oriented and very consistent syntax– Tens of thousands of users– Hundreds of thousands of pages (10% of the internet) report usage

History of PHPHistory of PHP

• PHP 4.0 (1999)– New “Zend Engine” at the core

• Named after Zeev Suraski and Andi Gutmans• Handled third party databases much more efficiently

– Improved portability with a wider variety of server compatibility– Provides more secure transfers of information– Hundreds of thousands of users– Several millions of pages (20% of the internet) report usage

• PHP 5.0 (2004)– Had several pre-releases– Zend Engine 2.0– Dozens of new features

History of ASPHistory of ASP

• “Classic” ASP– ASP 1.0 (1996)

• Supports interpreted VBScript and JScript

– ASP 2.0 (1997)– ASP 3.0 (2000)

• ASP.NET– ASP.NET 1.0 (2002)

• Can replace HTML scripting with full support for .NET languages• In-page scripts are still supported• VB.NET and C# classes can generate pages

– ASP.NET 2.0 (2005)• Scheduled release of November 7th

• Easier to use, “drag-and-drop”, interface

PHP FeaturesPHP Features

• Source code is not sent to the browser• Code is bracketed by “<?” and “?>”• Can be inserted into HTML code or can be a

stand alone application• File extension needs to be .php, .php3, .php4,

etc.• Server must have PHP interpreter installed• Supports database control• Source code is OPEN

ASP FeaturesASP Features

• Source code is not sent to the browser

• Code is bracketed by “<%” and “%>”

• Can be inserted into HTML code or can be a stand alone application

• Supports a wide variety of .NET languages

• Server must have ASP.NET installed

• Supports database control, but may need third party drivers

• Source code is CLOSED

Code DemosCode Demos

• Demo 1: Simple Password GeneratorPHP Code | ASP Code | Output

• Demo 2: Sessions & CookiesPHP Code | ASP Code | Output

• Demo 3: Database ConnectivityPHP Code | ASP Code | Output

Comparison of ASPComparison of ASP

• Pros– Professional tech support– Versions are documented at msdn.microsoft.com– Run on many company intranets– Has a familiar Microsoft environment – Widely available

• Cons– Only practical to run on a Windows server– Support can be expensive

Comparison of PHPComparison of PHP

• Pros– Open source– Freely available– Very portable– Active user community– Uses relatively little processor power

• Cons– More CPU intensive on a large scale– Extensibility is relatively limited

ASP vs. PHPASP vs. PHP

ASP PHP

LanguagesVBScript, JavaScript, C#, etc.

PHP

Platforms

Windows (others can be used, but third party software is needed)

Any platform for which the source code is available

Portability Poor Excellent

Scalability Good Poor

Source Code Closed Open

Learning Curve Low Medium

Questions?Questions?

ReferencesReferences

• Wikipedia.org– http://en.wikipedia.org/wiki/Active_Server_Pages

• Glasshaus.com– http://www.glasshaus.com/samplechapters/1086/chap

ter8.asp

• Php.net– http://www.php.net/history

• Apache.org– http://httpd.apache.org/docs/1.3/howto/ssi.html