jwisneski2003
09-29-2005, 08:33 AM
hello all,
i have a simple html form to which i want to add a select (drop down list)
the following html code works fine with the cgi-script untill i add a select box to it... when i add the drop down list to the html form of course it works but no combination of $name , or $selectname, etc that i add to the corresponding cgi-script will get the script to recognize the html code as it does the other code (the input text box's) MY QUESTION...how can this or any select name (drop-down) box be added to my form so it will run, or what do i have to add to the cgi-script thanks john
P.S. i have uploaded the associated cgi-lib file as a text file being over 10K total i couldn,t put it here directly
<html>
<body>
<form action="./cgi-bin/confirm.cgi" method="post">
<h3>This form sends an e-mail </h3>
Name:<br>
<input type="text" name="name"
value="" size="20">
<br>
Mail:<br>
<input type="text" name="email"
value="" size="20">
<br>
Comment:<br>
<input type="text" name="comment"
value="" size="40">
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
#!/usr/bin/perl
require "cgi-lib.pl";
&ReadParse(*input);
$name=$input{'name'};
$email=$input{'email'};
$comment=$input{'comment'};
$remote_addr=$ENV{'REMOTE_ADDR'};
$remote_host=$ENV{'REMOTE_HOST'};
$remote_ident=$ENV{'REMOTE_IDENT'};
$remote_user=$ENV{'REMOTE_USER'};
$browser=$ENV{'HTTP_USER_AGENT'};
$date=`date`;
chop($date);
##
## Print HTML Header
##
print <<BLOCK_O_TEXT;
Content-type: text/html
<html>
<head>
<title>CSET 4100 - CGI Example</title>
</head>
<body>
<CENTER>
<p> </p>
<Font size=+1><b>$name, your form data has been sent collected.<br><br>
Thank you from john wisneski </Font></b>
</CENTER>
<p> </p>
BLOCK_O_TEXT
print "Today's Date: $date<p>";
print "Complete Name: $name, $name<br>";
print "Email: $email<p>";
print "comment: $comment<p>";
print "</BODY>\n";
print "</HTML>\n";
#when your program is working, add my email address
#open (MAIL, '|mail tkoluch@UTN.UToledo.edu, jwisneski2003@yahoo.com');
open (MAIL, '|mail jwisneski2003@yahoo.com');
select(MAIL);
print "\n";
print "A visitor from the remote host: $remote_host\n";
print "Located at IP address: $remote_addr\n";
print "Completed the form on: $date\n\n";
print "------------------------------------------------------\n\n";
print "FORM CONFIRMATION\n\n";
print "Complete Name: $name, $name\n";
print "Age: $age\n";
print "comment $comment\n";
print "Email: $email\n\n";
print "\n";
select(STDOUT);
close (MAIL);
<select name="cars">
<option value="volvo">Volvo
<option value="saab">Saab
<option value="fiat">Fiat
<option value="audi">Audi
i have a simple html form to which i want to add a select (drop down list)
the following html code works fine with the cgi-script untill i add a select box to it... when i add the drop down list to the html form of course it works but no combination of $name , or $selectname, etc that i add to the corresponding cgi-script will get the script to recognize the html code as it does the other code (the input text box's) MY QUESTION...how can this or any select name (drop-down) box be added to my form so it will run, or what do i have to add to the cgi-script thanks john
P.S. i have uploaded the associated cgi-lib file as a text file being over 10K total i couldn,t put it here directly
<html>
<body>
<form action="./cgi-bin/confirm.cgi" method="post">
<h3>This form sends an e-mail </h3>
Name:<br>
<input type="text" name="name"
value="" size="20">
<br>
Mail:<br>
<input type="text" name="email"
value="" size="20">
<br>
Comment:<br>
<input type="text" name="comment"
value="" size="40">
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
#!/usr/bin/perl
require "cgi-lib.pl";
&ReadParse(*input);
$name=$input{'name'};
$email=$input{'email'};
$comment=$input{'comment'};
$remote_addr=$ENV{'REMOTE_ADDR'};
$remote_host=$ENV{'REMOTE_HOST'};
$remote_ident=$ENV{'REMOTE_IDENT'};
$remote_user=$ENV{'REMOTE_USER'};
$browser=$ENV{'HTTP_USER_AGENT'};
$date=`date`;
chop($date);
##
## Print HTML Header
##
print <<BLOCK_O_TEXT;
Content-type: text/html
<html>
<head>
<title>CSET 4100 - CGI Example</title>
</head>
<body>
<CENTER>
<p> </p>
<Font size=+1><b>$name, your form data has been sent collected.<br><br>
Thank you from john wisneski </Font></b>
</CENTER>
<p> </p>
BLOCK_O_TEXT
print "Today's Date: $date<p>";
print "Complete Name: $name, $name<br>";
print "Email: $email<p>";
print "comment: $comment<p>";
print "</BODY>\n";
print "</HTML>\n";
#when your program is working, add my email address
#open (MAIL, '|mail tkoluch@UTN.UToledo.edu, jwisneski2003@yahoo.com');
open (MAIL, '|mail jwisneski2003@yahoo.com');
select(MAIL);
print "\n";
print "A visitor from the remote host: $remote_host\n";
print "Located at IP address: $remote_addr\n";
print "Completed the form on: $date\n\n";
print "------------------------------------------------------\n\n";
print "FORM CONFIRMATION\n\n";
print "Complete Name: $name, $name\n";
print "Age: $age\n";
print "comment $comment\n";
print "Email: $email\n\n";
print "\n";
select(STDOUT);
close (MAIL);
<select name="cars">
<option value="volvo">Volvo
<option value="saab">Saab
<option value="fiat">Fiat
<option value="audi">Audi