HTML Form Menu -> CGI Script

liunx

Guest
Hi,

I am trying to have a multiple-select form menu that allows users to choose their favorite golf course (see <!-- w --><a class="postlink" href="http://www.mattcassarino.com/home.html">www.mattcassarino.com/home.html</a><!-- w -->)

The CGI script takes the value and sends it to me via email. It works fine if the user ONLY selects one golf course. However, the CGI script will only pass the last value if the user selects MULTIPLE items. I don't know how to fix this, please help!!

Thanks!
MattYou can use a cgi/perl script on the server side to parse the form and pass the multiple values like so:

if (defined($FORM{$name})){
$FORM{$name}.="\0";
}
$FORM{$name} .= $value;


add the above lines to the end of just about any standard form parsing routine to decode mutiple values.
Change $FORM{$name} to whatever syntax you use in your script to decode name/value pairs: ie $FORM{$in} or $CGI{$in}.

Regards,
Kevin
 
Back
Top