search redirect ???
hi,
anyone know how to redirect a form to different cgi script...????
i have two search scripts....
one for my searching on my page
and the other one search the web...
the two scripts works independent....
now i want to use the two script with one form...
anyone know or have allready create it.??
------------------
Orpheus posted this at 14:23 — 9th February 2000.
They have: 568 posts
Joined: Nov 1999
The only thing I can think of is to combine the two scripts. Or make some sort of JavaScript setup that will open 2 windows with 1 mouse click.
kumanan posted this at 14:48 — 9th February 2000.
They have: 23 posts
Joined: Jun 1999
hi,
i tried with this small perl code,
but it doesnt take the query ($q) variable...
it go to the different serach script but it doesnt put the query (the search word) behind the cgi script...
it returns with
/sr/cgi-bin/search.cgi?query=
it doesnt accept the $q variable
I hope someone can help me.....
this is my code
++++++++++++++++++++
#!/usr/local/bin/perl
#################
if ($ENV{"REQUEST_METHOD"} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; }
else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
$q = $form{'query'};
$urltl = "/sr/cgi-bin/search.cgi?query=$q";
$urlweb = "/cgi-bin/alta/plebiusvista.pl?q=$form{'query'}";
if ($FORM{'rd'} eq 'tl')
{
print "Location: $urltl\n\n";
exit;
}
if ($FORM{'rd'} eq 'web')
{
print "Location: $urlweb\n\n";
exit;
}
+++++++++++++++
------------------
ukcraig posted this at 00:19 — 19th February 2000.
They have: 52 posts
Joined: Nov 1998
Like this ? http://www.ten-tenths.com/search/
This is a slighlty modified (though not yet operational) version of a script from http://www.technotrade.com/cgi/engines/
Hope this helps.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.