Code
Samples
- Example HTML form with JavaScript - Handy
JavaScript dialogs, events, and menu changes
- Example HTML form 2 - More fun with
JavaScript
- Follow the Bouncing Window - Window
manipulation with screen coordinates and simple calculations
- Zebulex Products Order Form - Form
field access and calculations
- Zebulex Products Order Form v2.0 -
Shipping costs, data checking, and dollar amount display are added here
- Totals Form - Keyboard event
intercepts, browser dependencies, email validation with regular
expression
- Cookies and Date Object - Set and read
cookies, get and manipulate current date/time from client.
- Cookies and History Object - Cookies with
individual visit counter, writing greeting to document, and history
object buttons.
- Server Side Includes
Demo
- Perl Examples
- hello1.plAccepting line input,
string formats, and arrays.
- example1a.plParsing tab separated
export data and making a password lookup hash table for login.
- example1b.plSame as above with
function for login check.
- example2.plA skeletal program with
examples of loops, decisions, and hashes.
- wordcount.plWord counting made
easy with associative hashes and sorting.
- cgi1.cgiA simple CGI program to
introduce parsing form data, content header, and the CGI environment
variables. Try it locally with IndigoPerl as
http://localhost:4444/cgi-bin/cgi1.cgi Try using a URL with a query
string in the form of
http://localhost:4444/cgi-bin/cgi1.cgi?param1=value1¶m2=value2&name=Joe+Smith
Try using it with a form like testform.html
and see what happens. You can also upload this CGI to
student.siskiyous.edu and view the results there.
- cgi2.cgiThe intro CGI program adapted
for the student web server and with an email link using form variables
from testform.html.
- testform2.htmltestform.html
adapted for the student server for use with cgi2.cgi
- Order form with CGI
and inventory editing
- order1.cgi CGI program for
receiving data from the order form and echoing back the order with
totals
- orderform2.htm The order form
with added product codes to communicate with the CGI program
- datafile.txt The text data file
containing product info
- inventory1.cgi A program to
display the product data with links for editing each product
- editProduct.cgi A program to
dispaly an edit form for one product
- saveProduct.cgi A program for
saving changes on an edit product form
- saveProduct.cgi-2
Alternative version of saveProduct using CGI.pm
- GetInventory.pm A Perl module
for displaying the product inventory info
- Hourly tracking form
with viewer
- hours1.html Simple hours
submission form
- hours1.cgi Program to receive
hours and add them to data in a file
- hours2.cgi Program to view
accumulated totals in data file
- hourdata.txt Sample total
hours data file
- hours1a.cgi Alternative
version of hours1.cgi using MyCGI.pm (see below)
- MyCGI.pmSimple alternative to CGI.pm
Most form elements can be accessed as $cgi->name and all as
$cgi->{'name'}
- Simple menu order
tracking program
- menu1.html Menu selector to
submit to menu1.cgi
- menu1.cgi Program to receive
menu selections and add them to data in a file
- menudata.txt Sample data
file for reference
- MyCGI.pm Don't forget to have a
copy of MyCGI.pm in the same directory so this will work
- Menu V2.0 - Loaded
with new features! All items generated from a menu data file, submissions
checked against the menu, a new data file for each day, and flexible
interpretation allows new menu selectors to be added in the data file.
- getmenu.cgi Program to take
what's in menuitems.txt and generate HTML like in menu1.html above
- menuitems.txt Menu item
data file to generate form and check data
- menu1.cgi Program to receive
menu selections and add them to data in a file. Now adapted to handle
whatever selectors are specified in menuitems.txt
- orders2002_4_11.txt
Sample of what the daily data file format looks like
- MyCGI.pm Don't forget to have a
copy of MyCGI.pm in the same directory so this will work
- Menu Editor - CGI
programs for use with the menu stuff above to change the menu around
- geteditform.cgi Takes
the contents of menuitems.txt and presents an editing form.
- editmenu.cgi Takes the
submit data from the edit form and stores it into menuitems.txt
- editmenu.html A test form
for developing and debugging the JavaScript for the menu edit form. Note
that the field hidden in the real form is visible here.
- Date and Time
Functions in Perl
- time.cgi - Example program
using common date and time functions
- month1.cgi - Program to
display calendar for this month
- month2.cgi - Month display
with navigation buttons and highlight on today's date
- month3.cgi - Month set up
with links for each day's schedule.
- getday.cgi - Program called
through JavaScript to fill in day's schedule using month3.cgi above.
- Sending Email with
CGI/Perl - Use of Net::SMTP for platform independent mailing code
- mail1.cgi - Use of Net::SMTP
for platform independent mailing code
- mailform.html - Form for
sending feedback to a hidden email address
- mail2.cgi - Program to send
mail based on form data from mailform.html above
Questions? Email me.
