1 Database Driven Web Application Clients Application Servers
including web servers Database Server Traditional client-server
(2-tier architecture): client: user interface database server:
stores data. business logic: resides on both Three or multi-tier
architecture: Presentation layer: client, browser Business layer:
web server, handles web requests and actual functionality Database
layer: database server, stores data Slide 2 2 Three-Tier
Architecture Slide 3 3 Benefits of Web Applications Standard &
thin client: web browser Easy maintenance both server and client
Easy upgrade both server and client Fast development Mature
technologies and platforms Security https, password protection,
firewall transparent Limitations Compatibility of different web
browsers Limited functionalities Slide 4 4 Web Technolgies
Client-side HTMLCSS (Cascading Style Sheets) XML (Extensible Markup
Language) JavaScriptVBScript FlashJava applet Server-side oPHP PERL
/ CGI oASP (Active Server Pages) & ASP.NET oJSP (Java Server
Pages)Java Servlets oC++/C Database ODBC, JDBC MS SQL, Oracle, DB2,
my sql Slide 5 5 Web Application Option1: LAMP LAMP LAMP Linux OS
Linux OS Apache Web Server Apache Web Server MySQL Database MySQL
Database PHP scripting (Hypertext Preprocessor) PHP scripting
(Hypertext Preprocessor) Advantage Advantage Free Free Open source
Open source Proved to be one of the most reliable ways for web
development Proved to be one of the most reliable ways for web
development Disadvantage Disadvantage Tech support Tech support
Higher HR cost Higher HR cost Slide 6 6 Web Application Option2:
Microsoft Microsoft technologies Microsoft technologies Windows
2003 / vista OS Windows 2003 / vista OS IIS (Internet Information
Server) Web Server IIS (Internet Information Server) Web Server SQL
Database SQL Database ASP.NET scripting (Active Server Page)
ASP.NET scripting (Active Server Page) Advantage Advantage Tech
support Tech support Fast development Fast development Lower HR
cost Lower HR cost Continuous improvement on reliability and
security Continuous improvement on reliability and security
Disadvantage Disadvantage Commercial software Commercial software
Not open source Not open source Security, reliability and stability
Security, reliability and stability Slide 7 7 Web Application
Option3: Java Java technologies Java technologies Unix / Linux OS
Unix / Linux OS Apache + Tomcat / Websphere / Weblogic Web Server
Apache + Tomcat / Websphere / Weblogic Web Server Oracle / Sybase /
DB2 / Mysql Database Oracle / Sybase / DB2 / Mysql Database JSP
scripting (Java Server Page) and Servelet JSP scripting (Java
Server Page) and Servelet Advantage Advantage Proved to be one of
the most reliable and secure ways for web development Proved to be
one of the most reliable and secure ways for web development Many
third party software Many third party software Disadvantage
Disadvantage High development cost High development cost High HR
cost High HR cost Future unclear Future unclear Slide 8 HTML
www.w3schools.com 8 Slide 9 9 Forms HTML and forms are used to
build front-end application CGI/ASP/PHP/JSP are used to build the
back-end application A Form A Text Input Box A Radio Button A Check
Box A Hidden Varible A Submit Button Slide 10 10 Apache, MySQL and
PHP Integration Slide 11 11 PHP Error Turn on php error reporting:
For development server, very useful; for production server, dont do
that. php.ini display_errors = On error_reporting = E_ALL &
~E_NOTICE httpd.conf php_flag display_errors on php_value
error_reporting 2039 Slide 12 12 PHP Overview Open Source
server-side scripting language designed specifically for the web.
Conceived in 1994, now used on +10 million web sites. Outputs not
only HTML but can output XML, images (JPG & PNG), PDF files and
even Flash movies all generated on the fly. Can write these files
to the file system. Supports a wide-range of databases (20 + ODBC).
PHP also has support for talking to other services using protocols
such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP. Easy learning curveEasy
learning curve Syntax Syntax Perl- and C-like syntax. Relatively
easy to learn. Large function library Embedded directly into HTML
The separation of HTML design and PHP tagsThe separation of HTML
design and PHP tags Interpreted, no need to compile Slide 13 On
server, save it as e3.php in $HOME/.WWW-orion/, On client browser,
visit http://orion.csl.mtu.edu/~yourid/e3.php Slide 17 17 Control
Structures Conditional structures (e.g. if/else) Repetition
structures (e.g. while loops). Example if/else if/else statement:
if ($foo == 0) { echo The variable foo is equal to 0; } else if
(($foo > 0) && ($foo