Project 2 - Basic CGI Script
Overview
Environment variables are very useful in CGI scripting and
they are quite easy to access with perl. This quick script
will just get you familiar with the logistics of writing and
running a CGI script on your server and will also illustrate
the use of environment variables.
We haven't gotten too far into the marterial yet, so this
project is pretty straightforward. We will revisit this script
later and make some modifications, so be sure to comment your
code!
Preparation
Objectives
- Learn to write a basic perl CGI script
- Become comfortable uploading and running scripts on your
server
- Understand the role of environment variables
Script Details
Write a perl script that is called with no parameters (ie.
just click on link to the CGI to run the script). The script
should examine the environment variables and determine the
URL of the previous page visited by the user. It should then
generate an HTML page that displays the user's hostname and/or
IP address and a "Go Back" link to the previous
page.
Demo
script
Project Submission
You should have a link to the functional script from your
main project website. Email the text of the script and the
working URL to cgi@iteachu.com
by the deadline date in the schedule.
Jump
to Forums [Project 2]
|