![]() |
Web Conference 2004Writing Perl/CGI Scripts for ITS/ASET Web servicesExercises |
| <- Back - Security | | | Up | | | Done - References |
| All skill levels are encouraged to use whatever resources they have available to them, including the O'Reilly Safari Network (see References page). |
Go through all of the exercises listed on this site. Some scripts may need to be copy/pasted from the Web pages.
Write a script accept 3 CGI parameters and write an
if($parameter1 eq "value") test for each to print
different results for each paramter.
Write a script to output an HTML form if it did not receive and parameters or print the parameters received.
Write a script to show 3 different pages depending on what parameter is passed.
Generate a simple inventory form using SQLite. Use the previous exercise as an example.
Write a script to save a series of 5 parameters to a comma
separated (CSV) data file. Then make it read the file when the
parameters are not sent by the user and print a Web page form with the
parameters as suggested values (hint: <input type=text
name=param1 value="saved-value">). You may substitute other
data formats such as XML and may use a prebuilt module (if installed)
or write the format routines yourself.
Build a 3 page site using a single CGI as in the beginners session, but also add an image file - <img src="your_script.cgi?page=image"> - and load an image file (of your choosing) and set the proper MIME type. (image/gif or image/jpg)
Be inspired! Build a CGI/Cookie login system using rand() to generate semi-random session ids, and Digest::MD5 to create hash keys. Use SQLite as your database.
| <- Back - Security | | | Up | | | Done - References |
If you have any questions, feel free to ask me - mailto:jcd@psu.edu
Content by: Jeff D'Angelo <jcd@psu.edu> © 2004
Last update on: Monday, 14-Jun-2004 00:31:41 EDT