Professional Documents
Culture Documents
Dynamic Documents
• Years ago… the WWW was made up of • Dynamic Documents can provide:
(mostly) static documents. – automation of web site maintenance
– Each URL corresponded to a single file stored – customized advertising
on some hard disk. – database access a!
l ide
• Today - many of the documents on the – shopping carts Coo
WWW are built at request time. – date and time service
– URL doesn’t correspond to a single file. – well paying jobs for netprog students.
1 2
• We want to provide a time and date service. – Listen on a well known TCP port.
• Anyone in the world can find out the date – Accept a connection.
and time (according to our computer)!!! – Find out the current time and date
• We don’t care what is in the http request, – Convert time and date to a string
our reply doesn’t depend on it. – Send back some http headers (Content-Type)
– Send the string wrapped in HTML formatting.
• We assume the request comes from a
– Close the connection.
browser that wants the content formatted as
an HTML document.
5
loop forever 6
9 10
17 18
<HR>
• If you want the server to handle SSI
directives you should name the file <H3> Here I forgot to use the HTML
<CODE><PRE></CODE> tag:</H3>
something.shtml (not something.html)
<!--#exec cmd="ls -al"-->
23 24
Another SSI Example
<!--#INCLUDE FILE="header"-->
More Power
It is now:
<!--#config timefmt="%I:%M 0 (%Z)"-->
• Some servers support elaborate scripting
<!--#echo var="DATE_LOCAL"-->
<BR> languages.
Today is: • Scripts are embedded in HTML documents,
<!--#config timefmt="%A, %B 0.000000e+00, %Y"-->
<!--#echo var="DATE_LOCAL"--><BR>
the server interprets the script:
– Microsoft Active Server Pages (ASP)
<!--#INCLUDE FILE="footer"--> • JScript, VBScript, PerlScript