dvdch
03-24-2006, 02:25 AM
Hey. I have a CGI script that lets a user choose a website from a list and then opens that website in a new browser window.
The script is located at http://www.stormrazor.com/select2.html
My questions are:
1) Is there a more current or efficient script out there that will do the same thing?
2) Does anyone know much cgi server resources this script would use if thousands of users used it per day?
My hosting service mentioned that they would limit cgi access to websites that used too much of their server's cgi resources.
3) Is there a php script that would do the same thing? My hosting service didn't mention any limitations on php scripts.
The cgi script is listed below. I got it from someone named Ian Rochat
==============================================
if ($ENV{'REQUEST_METHOD'} eq "POST") {
# Content Length should never be very big, quit if it's more than 8192 bytes
if ($ENV{'CONTENT_LENGTH'} > 8192) { exit(2) }
read(STDIN,$form_data,$ENV{'CONTENT_LENGTH'});
}
else {
$form_data = $ENV{'QUERY_STRING'};
}
%VARS = split(/[=&]/,$form_data);
$VARS{'URL'} =~ s/%(..)/pack("c",hex($1))/ge;
print "Location: $VARS{'URL'}\n\n";
return(0);
==============================================
The HTML code for the webpage is below. I used the target="_blank" tag to open the links in a new browser window.
<HTML>
<HEAD>
<TITLE>Select</TITLE>
</HEAD>
<BODY>
<center>
<p>
<FORM method="GET" action="/cgi-bin/selector.cgi" target="_blank">
<SELECT name="URL">
<OPTION SELECTED value="http://www.google.com/">Google</OPTION>
<OPTION value="http://www.yahoo.com">Yahoo</OPTION>
<OPTION value="http://www.altavista.com">AltaVista</OPTION>
<OPTION value="http://www.dogpile.com">Dogpile</OPTION>
<OPTION value="http://www.lycos.com">Lycos</OPTION>
</SELECT><INPUT name="Submit" type="submit" value="Go">
</FORM>
</center>
</BODY>
</HTML>
==============================================
Any help would be appreciated.
Thanks,
David
.
The script is located at http://www.stormrazor.com/select2.html
My questions are:
1) Is there a more current or efficient script out there that will do the same thing?
2) Does anyone know much cgi server resources this script would use if thousands of users used it per day?
My hosting service mentioned that they would limit cgi access to websites that used too much of their server's cgi resources.
3) Is there a php script that would do the same thing? My hosting service didn't mention any limitations on php scripts.
The cgi script is listed below. I got it from someone named Ian Rochat
==============================================
if ($ENV{'REQUEST_METHOD'} eq "POST") {
# Content Length should never be very big, quit if it's more than 8192 bytes
if ($ENV{'CONTENT_LENGTH'} > 8192) { exit(2) }
read(STDIN,$form_data,$ENV{'CONTENT_LENGTH'});
}
else {
$form_data = $ENV{'QUERY_STRING'};
}
%VARS = split(/[=&]/,$form_data);
$VARS{'URL'} =~ s/%(..)/pack("c",hex($1))/ge;
print "Location: $VARS{'URL'}\n\n";
return(0);
==============================================
The HTML code for the webpage is below. I used the target="_blank" tag to open the links in a new browser window.
<HTML>
<HEAD>
<TITLE>Select</TITLE>
</HEAD>
<BODY>
<center>
<p>
<FORM method="GET" action="/cgi-bin/selector.cgi" target="_blank">
<SELECT name="URL">
<OPTION SELECTED value="http://www.google.com/">Google</OPTION>
<OPTION value="http://www.yahoo.com">Yahoo</OPTION>
<OPTION value="http://www.altavista.com">AltaVista</OPTION>
<OPTION value="http://www.dogpile.com">Dogpile</OPTION>
<OPTION value="http://www.lycos.com">Lycos</OPTION>
</SELECT><INPUT name="Submit" type="submit" value="Go">
</FORM>
</center>
</BODY>
</HTML>
==============================================
Any help would be appreciated.
Thanks,
David
.