I am writing a CGI Script like the guestbook.cgi script.
I want following actions to occur:
a. Menu item calls my script (cgi).
b. Script displays a menu with four items on it.
c. Menu items calls form (sub routine) i.e.,
sub entry_form { my $q = shift; my $url = ""> my $form =
<<E_FORM;
<h3>Hello!</h3> <form action="" method="post"> <p><b>My name is</b>: <input type="text" name="name"/></p> <p><b>My E-mail is</b>: <input type="text" name="email"/></p> <p><b>Message</b>:</p> <p><textarea cols="30" rows="6" wrap="virtual" name="message"></p> <p>Type your message here. </textarea> <input type="submit"></p> </form> E_FORM $form;
} d. I want to use my %input vice my $q. e. I want the hash receive the input from the form.
f. I do not know if the syntax shown in example in 'c' above
will work or do I need something like:
print "<input type=\"text\" name=\"fname\"
value=\"$input{'name'} \"
size=15 maxlength=20>"\n; In other words, I want a self contained script (the script
displays forms, process form info, and sends mail, etc).
see attached file guestbook.cgi
Horace
----- Original Message -----
From: "Hanson, Rob" <[EMAIL PROTECTED]>
To: "'Horace Franklin Jr.'" <[EMAIL PROTECTED]>
Sent: Thursday, March 20, 2003 5:22 PM
Subject: RE: Hash/Associtative Array > would look like this... > > use CGI ':standard'; > > my $fname = param('fname'); > > The "use CGI" part is a bunch of libraries to help in CGI scripting. > Checkboxes are the same, except that param('chkbox') won't be defined if it > wasn't checked. > > Was that your question? > > Rob > > > -----Original Message----- > From: Horace Franklin Jr. [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 20, 2003 6:22 PM > To: Hanson, Rob > Subject: Hash/Associtative Array > > > Sir, > > Please accept my apology for contacting you directly. I am desperate. > Please let me explain, I have been reading several perl books since I > last asked a question about perl: CG I Script [guestbook.cgi] > > I am fascinate with the capabilities of the Hash/Associtative array: > my %array I have also learned about my and local. > > I want to take advantage of the assocititave array. How can I > accomplish the following? > > Use a Hash/Accositative array to recevie input from a form in a perl script: > Is think this is the correct syntax to accomplish the desired effect but I > am > not certian. > print "<input type=\"text\" name=\"fname\" value=\"$input{'fname'} \" > size=15 maxlength=20>"\n; > > What is the syntax if I wanted receive input from a checkbox? > Is it different? > > Any assistance will be greatly appreciated. > > Horace |
guestbook.cgi
Description: Binary data
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]