HTML and CSS Reference
In-Depth Information
example 5.1: the file structure of a typical website (continued)
|_ images /* Directory for images */
| |_logo.png
|_index.html /* The default index page */
|_ scripts /* For client-side scripts */
he ile and directory names used in Example 5.1 are commonly used by
many web developers. here are no standards for these names. he website
would function the same with diferent names. his is just how many web
developers initially structure a website.
he top level of Example 5.1's ile structure is a directory containing three
subdirectories: cgi-bin, logs, and public_html.
his is a designated directory for server-side scripts. Files in this directory,
such as formmail.cgi, contain executable code written in a programming lan-
guage such as Perl, Ruby, or Python. he cgi-bin directory is placed outside the
website's document root for security reasons but is aliased into the document
root so that it can be referenced in URLs, such as in a form element's action
<form action=" /cgi-bin/formmail.cgi " method="post">
When a web server receives a request for a ile in the cgi-bin directory, it
regards that ile as an executable program and calls the appropriate compiler
or interpreter to run it. Whatever that program writes to the standard output
is returned to the browser making the request. When a CGI request comes
from a form element like that just shown, the browser also sends the user's
input from that form, which the web server makes available to the CGI pro-
gram as its standard input. formmail.cgi, by the way, is the name of a widely
used Perl program for emailing users' form input to site administrators. he
original version was written by Matthew M. Wright and has been modiied by
others over time.
Search WWH ::

Custom Search