HTML TUTORIAL


Introduction and History

File transfers were made possible with the earliest versions of internet software; the program that handles file transfers still survives more or less intact - ftp. As internet users started to place files for public access, advertising their wares on bulletin boards, some people started distributing "lists" of hot ftp material on bulletin boards.

Along came archie, a program to locate ftp sites using a keyword search. This program worked by collecting data at archie servers (located at some sites) and allowing archie clients to connect to the servers to search.

The next development was gopher (created at the University of Minnesota), a utility which combined several tools (a file viewer, ftp and telnet) in a single easy-to-use menu-driven interface.

At the same time, the publishing industry had been experimenting with so-called hypertext documents (electronic documents with nonlinear organization of data) -- on single machines. A standard called SGML (Standard Generalized Markup Language) was developed to write hypertext documents in free ascii-text (similar to Latex, troff etc).

Ideally, SGML should be integrated with TCP/IP to provide links across the network. But SGML is large and complex. Thus came HTML (HyperText Markup Language), a much simpler formatting language developed by CERN in Switzerland that uses TCP/IP.

The whole idea in using HTML is to display more than text, that is, formatted text and images. For this, a "browser" is needed - most often, a browser written for a windowing package such as xmosaic (the first browser) written for X-windows.


HTML Basics


Adding Links to Documents


Images and Other Things


Homepages

You now want to know where to place files that others can view: your homepages.

  • In Unix, you need to create a subdirectory off of your main directory and call it public_html.

  • Note: webservers differ in what they want you to use as "home" directories.

  • In the subdirectory public_html, create a file called index.html. When someone accesses your homepage by just giving your username, it is this file that is brought up. Thus, the URL
  •     http://www.seas.gwu.edu/~simha
    
    is really the file public_html/index.html, which the webserver knows to get. (You don't have to understand this last point). Make sure that you grant public access to this directory and to the files you place in the directory.

  • You can now place all other files you want others to access in the directory public_html. For example, if I create my CV in an HTML file called cv.html, put the file in the directory public_html, and refer to it by the URL:
  •     http://www.seas.gwu.edu/~simha/cv.html
    
    then others can `open' this URL and get the file.


    Advanced Stuff


    Executing Code (CGI Programming)

    Consider this example:
        <body>
          <h1> What's new in this homepage </h1>
            <!--#include file="whatsnew.html">
          <h1> Current directory of files </h1>
            <!--#exec cmd="ls">    
        </body>
    
    The ls command gets executed; the returned text is simply fedback to the browser as text in the <pre> format. Instead of "ls" you can call any program or script; these executables can return text or even html documents (with html commands). Now let's look at some other input mechanisms.