Transcript Document

Website Design
Lecture 1
Outline



Introduction to the module
Outline of the Assessment Schedule
Lecture




Static XHTML, client side and server side
Why server side
What are the options (ASP/PHP/ColdFusion)
Setting up your own server
Important information
Just in case you forgot




Steve Wade
CW4/06
[email protected]
01484 472524
Introduction to Module - Aims

To give the learner an in-depth understanding of
the role of different programming languages in the
design and development of server-driven web
environments.

To give the learner an in-depth understanding of
the role of databases in the design and
development of server-driven web environments.

To give the learner an in-depth appreciation of
both client- and server-side implications
associated with the delivery of database-driven
web applications.
Introduction to the Module synopsis

This module builds on the Web Authoring
module, extending the range of skills and
techniques developed to include server-side
scripting and database integration.
Outline of the year

Semester 1




Server side scripting
PHP
MySQL
Semester 2



ASP.NET
SQL Server
Modelling for Website Design
Assumed knowledge




XHTML
JavaScript
CSS
Be able to use Dreamweaver to create a
static website
Code



Static XHTML
 Pages/data do not change without designer input
 All users see the same page
Client side script (e.g. JavaScript)
 Data still stays the same
 Some customisation possible (e.g. colours, image changes)
 Validation of user input
Server side script (e.g. CGI, ASP, PHP, ColdFusion)
 Pages can be ‘made’ on the fly based on variables (e.g. search
input, previous choices made by the user on their last visit, inputs
from other sites or databases)
 Page is constructed at the server end, then sent as simple html
to the client
How does it work? HTML

First consider an HTML page:
 You go to a webpage e.g. http://www.w3schools.com/




The browser goes and find w3schools.com
Once found it sends a request for the index.htm file
The server finds that page and sends it to the browser
Once received the browser looks at the HTML code, reads
it and converts it to a pretty, colourful, but static page
How does it work? CGI

After HTML came CGI:

HTML is one way (only receives), so something was
needed to send information back to the server. forms and
CGI (Common Gateway Interface) were created

Forms used to get information from the user, then that
information is sent to the server where a separate program
is run to deal with it

Great for small apps like a guestbook, but downside is
every time someone sends something to the server, a
whole instance of the CGI program is created. E.g. 5
people on site equals 5 programs running. Imagine if
hundreds of people wanted to connect at the same time?!?
How does it work? Server
API’s

CGI too slow, so Server Application
Programming Interface born. ISAPI is the
Microsoft version

Similar to CGI, ISAPI much more efficient.
Doesn’t launch new version for every visitor
How does it work? ASP/PHP
etc




And then came ASP/PHP/ColdFusion
Solved all the problems of CGI and ISAPI,
and they are simpler to learn and easier to
use
CGI and ISAPI written in Perl or C
ASP/PHP/CFM simply write code in the
HTML, side by side

As with JavaScript
How does it work? ASP/PHP
etc

You go to a webpage e.g. www.mydomain.com/index.php

The browser goes and find mydomain.com

Once found it sends a request for the index.php file

The server finds that page and executes it, which means it looks
through the pages and runs any code in the page

After the code has run, all asp/php is removed from the result (so
people cannot steal it) leaving a pure HTML page

The HTML page is sent to the browser for rendering
PHP
HTTP
HTML
HTML
Client
Web server
Why server side









Content sites, catalogues (imagine news.bbc.co.uk with static
code?!)
Community features (forums etc)
Email (instead of mailto link, have a form on your site to be filled
in)
Technical support (search your problem, solutions
stored/updated in a database)
Web delivered business applications (e.g shopping trolleys)
Directories (e.g. uni has an online phonebook)
Surveys, polls, tests (storing results and generating reports)
Personalisation
Etc etc…
Server side options

ASP.NET (and the older v3.0)
 Microsoft
 Windows Server

PHP
 Open Source
 Apache Server

ColdFusion
 Macromedia
 Runs on a windows server with ColdFusion server installed

JSP
 Java Server Pages
Installing a server on your
machine

IIS


Windows XP Pro and Windows 2000/2003 as
standard
Apache




Easier to get a package (Apache, PHP, MySQL)
http://www.easyphp.org/
http://www.wampserver.com/en/index.php (the
one I use)
http://www.firepages.com.au/
Inside Uni




http://hermes.hud.ac.uk
PHP, MySQL
http://aspley.hud.ac.uk
ASP.NET,
Tutorial tasks



Make sure you can access
http://hermes.hud.ac.uk
Download file week1.php from my site and
test on hermes
Have a go at the first PHP exercises