I'm wanting to set up my search box to where there are option buttons. If one option is selected, the search term is searched at my site with the links2 search engine. If the other option box is selected, the keyword is copied and send to another site. Here is how I tried to set it up:
#######The Actual Form:
<form method=POST action="http://www.activewebmaster.com/cgi-bin/searchit/searchit.cgi">
<input size=25 name="key">
<input type=submit value="Search!">
<input type="radio" name="where" value="ActiveWebmaster" checked>ActiveWebmaster
<input type="radio" name="where" value="TheWeb">The Web</p>
</form>
################################
#######Here is the script I made the form points to:
(sorry, not too good at writing perl yet)
#!/usr/local/bin/perl
if ($FORM{'where'} eq 'ActiveWebmaster') {
$search = $form{'key'};
print "Location: http://www.activewebmaster.com/cgi-bin/links/search?query=$search\&mh=25\&type=keyword\&bool=and\n\n";
}
else {
$search = $form{'key'};
print "Location: http://www.bid4search.com/cgi-bin/smartsearch/bid4search.cgi?keywords=$search\n\n";
}
###########################End Script
For some reason, when I enter a word into the form, it always takes me to bid4search.com but doesn't put the keyword in.
Could someone please help me fix the form and/or script?
Best Wishes,
Eric J. Griffin
http://www.ActiveWebmaster.com - Webmaster Resources
#######The Actual Form:
<form method=POST action="http://www.activewebmaster.com/cgi-bin/searchit/searchit.cgi">
<input size=25 name="key">
<input type=submit value="Search!">
<input type="radio" name="where" value="ActiveWebmaster" checked>ActiveWebmaster
<input type="radio" name="where" value="TheWeb">The Web</p>
</form>
################################
#######Here is the script I made the form points to:
(sorry, not too good at writing perl yet)
#!/usr/local/bin/perl
if ($FORM{'where'} eq 'ActiveWebmaster') {
$search = $form{'key'};
print "Location: http://www.activewebmaster.com/cgi-bin/links/search?query=$search\&mh=25\&type=keyword\&bool=and\n\n";
}
else {
$search = $form{'key'};
print "Location: http://www.bid4search.com/cgi-bin/smartsearch/bid4search.cgi?keywords=$search\n\n";
}
###########################End Script
For some reason, when I enter a word into the form, it always takes me to bid4search.com but doesn't put the keyword in.
Could someone please help me fix the form and/or script?
Best Wishes,
Eric J. Griffin
http://www.ActiveWebmaster.com - Webmaster Resources