To Whom It May Concern: Here is the web site from my Winter 2004 Web Programming class. It's been pared down a little bit - because of the change in servers, the SSI and CGI scripts are no longer here, but pretty much everything else is -- assignments, links to external references, and examples of CSS, XML, DTDs, XSLT, JavaScript, and PHP.
I intend to leave this material available permanently but have no plans to extend or enhance it.
For any questions or problems, email me.
You will probably need to know more about Unix/Linux usage than is covered in these brief notes. See the Unix and Linux subsection of the Links section, below, for some online references.
Have a look at my simple example XHTML page. Observe what happens when you click on the "W3C" graphic at the bottom of the page (or at the bottom of this page). Then, view the source code for the page; you can do this in most browsers by selecting the "source" item in the "View" pulldown menu.
It's time for you to start reading some material on HTML and XHTML. Links to Dave Raggert's introduction to HTML, and the W3Schools site, are given below.
I've put some links to information about SSI (Server Side Includes) in the Links section and have enabled SSI on the server, including the exec directive. You should read the Introduction to SSI tutorial on the Apache website. (You may skip the material on server configuration.)
In addition to the Apache SSI, I've added a link to the complete Apache SSI documentation in the Links section.
The next topic is CGI programming. Have a look at the tutorials I've posted in the Links section.
You'll be doing CGI programming using the Perl language. It is not assumed that you have any previous exposure to Perl, but it is assumed that you have sufficient computer science background to pick up details of a programming language largely by self-study. Therefore, I'll spend very little time discussing Perl in class (maximum of two lectures), and you'll need to rely on your own reading to pick up the language details you'll need. For that purpose, I've posted some links to Perl material that should be sufficient. At some point, you'll probably want to read the Chapter on CGI programming in PERL that's included in A. D. Marshall's online textbook.
Be your own webmaster! If you're feeling ambitious, you can download the Apache webserver and install it on your PC. It's free. Apache comes with recent standard Linux distributions, and with Macintosh OS X, so if you have one of those platforms, you may already have Apache. You can download a Windows version from the Apache Download Page.
An advantage to doing this is that you can develop and test things that make use of server-side facilities such as SSI and CGI on your own computer. You will, of course, have to learn how to edit the Apache configuration file to enable the services that you want. (I can provide advice if you get stuck.)
For similar reasons, you might want to have Perl on your own computer. If you have a Linux, Unix, or Mac OS X platform, it's probably already installed. Free Windows implementations of Perl are available too. See the Perl links below for a link to one.
Perl Examples. I've started a repository of Perl examples on the oriole server. I'll add to it from time to time. There's a link to it in the Perl links section.
Forms are the HTML/XHTML mechanism for supplying user input to a CGI script. I've constructed an example of a site registration form of the kind found frequently on the web. (Clicking the "submit" button will give an error at this time because the CGI script to process it doesn't exist yet.)
Please read the W3C's Forms in HTML 4.0 document. This is a technical specfication of the form facility in HTML. (Note that to be correct XHTML, tags must be in lower case. Other than that, the specification applies to XHTML as well as HTML.)
You can view the CGI scripts discussed in Tuesday's class here:
Note: My copy of MS Internet Explorer botches the display by trying to render the scripts as HTML documents even though they clearly are not. If you have this problem, my advice is to switch to another browser. On a Windows platform, Mozilla, Firefox, and Opera should all do a better job. If you're involved in web programming or web design, you should have a variety of browsers on hand anyway for testing your work.
Have a look at my CGI Notes page. They provide step-by-step instructions for installing CGI scripts on the server, a summary of what CGI scripts need to do, and a pointer to some Perl code for parsing form data.
Your CGI assignment will appear in a few days.
As you know from last Thursday's class, there is now a CGI assignment. Due date is Thursday, March 25.
I've put up some XML links. At this point, you should read through the XML and DTD tutorials on the W3 Schools website. There will be an XML project; details forthcoming. Also, I've put up a small XML example of my own for hypothetical "interoffice memo" documents:
(Note: The errors in the xml and dtd documents have been fixed.)
A couple of followup notes to previous notes:
Oops. I found another error in the memo.dtd document. It's been fixed. Take a look.
XPath and XSLT are two XSL standards for denoting locations within XML documents and transforming XML documents to other formats, respectively. I've put links to the W3 Schools tutorials in the XML Links section. Read through them.
Here are some examples of how to style XML documents:
What you see in a browser when you click on the links above depends on what support the browser has for XML and XSL. Some browsers (e.g. the latest versions of MS Internet Explorer and Firefox) have reasonably complete support and will actually render the document as specified in the stylesheet. Some browsers (especially older versions) won't. To see the actual document without rendering, select "View document source" from the View menu in your browser.
An XSL stylesheeet that transforms XML documents to HTML can also be
applied on the server side, the result then being sent to the browser.
With this method, the browser does not have to have its own XML/XSL
support. Of course, the server has to have the necessary software.
On Oriole, the xsltproc command can be used:
xsltproc Style/memo_style.xsl my_memo.xml,
for
example.
JavaScript is the leading client-side scripting language in use on the Web today. Developed by Netscape to enable dynamic content in web pages, it is now supported by all modern full-featured browsers. The language has a strong family resemblance to C, C++, and Java, so the syntax should not be difficult to master. I've put links to two tutorials in the JavaScript part of the Links section. Read the first, then the second.
I've developed a small collection of JavaScript examples. Click on each link, then view the page source to see how JavaScript is used.
There is now a link to a complete manual on JavaScript 1.5 in the JavaScript links section.
A couple of pages that have nice examples of use of JavaScript "onMouseOver" events are the Eastern Michigan University Homepage and the DevEdge Netscape Sidebar Tabs page.
Your XML Assignment is now available. Have a look!
As an example of how to use the XSLT transformation language, I've created a DTD, an XML document that conforms to the DTD, a stylesheet for translating conforming documents to XHTML, and the XHTML result. You can see them all in this directory. Studying these files should give you some clues to approaching the XML assignment.
For some amazing examples of what can be done with Cascading Style Sheets, check out the CSS Zen Garden website.
I've started a directory of PHP examples. (Currently it contains just one example. ;-) You can view them on the web by clicking on the links in the directory listing. To see the actual PHP code, you need to log into the server, go to the /var/www/html/remmers/PHP/ directory, and view the files with a text viewer such as more.