5CC001 Web Application
Development
Dynamic websites
Alix Bergeret v3.0
Dynamic website construction
1.
2.
3.
4.
5.
Dynamic website?
Client-side scripting
Server-side scripting
Client-side or server-side?
PHP
1. Dynamic website?
Classical
hypertext navigation, with HTML
or XHTML alone, provides static content,
meaning that the user requests a web page
and simply views the page and the
information on that page.
1. Dynamic website?
However
the content of a dynamic page
might differ depending on:
data
in a posted HTML form
parameters in the URL
the type of browser being used
the passage of time
a cookie, session, database or server state
Examples
on next slides
4
1. Dynamic website?
The
content
displayed on the
Amazon home
page depends on:
Time
of the year
Previous
purchases
Stock availability
1. Dynamic website?
The
content of the
search result page
depends on the
keywords you
types in the search
box
1. Dynamic website?
I
think the most significant change in web
design this decade has been the evolution
to building dynamic sites.
Chris Coyier, .net magazine, April 2010
1. Dynamic website?
Most
websites we use every day are
dynamic (facebook, hotmail, youtube)
They
are often created with the help of serverside languages such as PHP, Perl, ASP,
ASP.NET, JSP, ColdFusion and other
languages.
Smaller
businesses still use static websites
(aka Billboard websites)
Here
is my favourite Keswick B&B (Alix )
8
2. Client side scripting
3. Server side scripting
10
4. Client side or server side?
Client side
Responses
to interaction are more
immediate
Secure (data doesnt leave your computer)
Plug-in/Browser Dependant
E.g. You must have JavaScript enabled
Processor
is bottleneck
Faster your processor, faster the website
11
4. Client side or server side?
Server side
Better
for more complex processes that
involve multiple resources, i.e. databases,
files
Security concerns
Sensitive data sent out
Independent
No specific browser/plug-ins required
Connection/Remote
Processor are
bottlenecks
12
4. Client side or server side?
For some applications, you dont have a
choice:
Animated menu, pop-ups, scrolling text
It
needs to be instant => Client side
Access to a database or a file on the
server
Needs
access to server => Server side
13
4. Client side or server side?
For other applications, both are possible
User
input validation
Drop-down list population
Which one should you go for?
14
4. Client side or server side?
Languages
Client
side:
JavaScript, VBScript
Server
Older executed by operating system
side:
C, Perl, Shell Scripts, CGI
Newer executed by web server
PHP, ASP, JSP, Cold Fusion, Python,
15
5. PHP
PHP is a widely used, general-purpose scripting
language that was originally designed for web
development, to produce dynamic web pages.
It can be embedded into HTML and generally runs
on a web server, which needs to be configured to
process PHP code and create web page content
from it.
It can be deployed on most web servers and on
almost every operating system and platform free
of charge.
PHP is installed on over 20 million websites and 1
million web servers.
(http://en.wikipedia.org/wiki/PHP)
16
5. PHP
How can it be used?
Websites
Command
GUI
Cross Platform
Windows
(all?) webservers - IIS, PWS, Apache, etc.
Output formats
Any
/ Linux / Unix / MacOS / etc.
Integration
Most
Line
- XML, XHTML, HTML, PDF, Flash, etc.
Object Orientated or Procedural
17
5. PHP
Parsing
Passes
the text of the file back to the webserver until it encounters <?
Executes PHP commands until it finds a ?>
Multiple <? ?> are allowed within a PHP file
18
5. PHP is relevant
244M
Can
sites as of January 2013
you name a couple?
Source: http://php.net/usage.php - Usage Stats for January 2013
19
5. PHP is relevant
Source: http://www.tiobe.com/tpci.htm - The Programming Community Index
20
What we have covered today
1.
2.
3.
4.
5.
Dynamic website?
Client-side scripting
Server-side scripting
Client-side or server-side?
PHP
21