Meaning of Life Guestbook

Lets build a web based Guest book that uses the Meaning of Life form you built

If you are online, try this url Guest Book

Here is an overview of what you will do.

guest

Lets take your Meaning of Life form and store the users name and meaning into the file meaning.txt.

Here are the steps

Make a copy of the perl parse script you built earlier and call it guestin.pl.

Now Insert the following between lines 11 and 12
(just after the line print "Content-type: text/html \n\n";

open(infile,">>meaning.txt");
print infile $FORM_DATA{'name'};
print infile "-";
print infile $FORM_DATA{'meaning'};
print infile "\n";
close(infile);

Save this script as guestin.pl and create an html form page to call this new script.
It should include a line like the following,

<form name='gestbook' action='cgi-bin/guestin.pl' method='post'>

Open your html page, fill out the form and submit it.

Check that the file meaning.txt exits and contains the required data.
(remember meaning.txt must have read/write permissions - chmod 666 meaning.txt).