I have a website with many pages that has the following form on every page:
<form method=get action="http://wwwWebmasterWorldebsite.com/cgibin/directory/index.cgi">
<input size=40 name=search>
<input type=submit value="Search " name="submit2">
<input type=hidden name="mode" value="searchbox">
</form>
I don't want to have to change the code on every page so what I would like to do is be able to substitute the "index.cgi" file, mentioned above, for one that will re-direct and change the form information to another cgi script.
The form input for the new script looks like this:
<form method=get action="http://www.myotherwebsite.com/cgibin/differentdirectory/search.cgi">
<input type="text" name="query" size="40" maxlength="200">
<input type="submit" value="Search " name="submit">
</form>
Any ideas?
See [webmasterworld.com...]
The topic is closely related. What you want is to have your index.cgi send a POST request to search.cgi and then print the response.
If anyone else is interested the code is as follows:
#!/usr/bin/perl
use CGI qw/:standard/;
my$search = param('search');
my$url = 'http://wwWebmasterWorldebsite.com/cgibin/anotherdirectory/search.cgi?query='.$search;
print header();
print qq(
<html>
<head>
<meta http-equiv="refresh" content="1;URL=$url">
</head>
<body>
If you are not forwarded <a href="$url">Click Here </a>
</body>
</html>);
exit;