Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

browser location bar

altering what is shown in the location bar



5:21 pm on Jan 21, 2002 (gmt 0)

Anyone know how to alter the url shown in browser location bar so that it does not show cgi info?
I'd like it to show just the mycompany.com when executing a cgi script rather than showing the actual loction (mycompany.com/cgi-bin/whois/whois?STRING=gerlbultro.com&SearchType=do&STRING2.x=31&STRING2.y=6 and stuff like that). I don't want to use frames.


5:23 pm on Jan 21, 2002 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

I naj, welcome to the forums. Use a POST instead of a Get.


4:41 pm on Jan 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi naj,

in the form that calls the cgi script, there are a couple of methods of transferring the data. The most commonly used are GET and POST. With GET, the data contained in the form is encoded and made part of the URL that calls the cgi script. With, POST, the data is encoded differently and not included in the URL. You want to use the POST method. Here's an example:

<form name="yourform" action="cgiprocessingscript.cgi" method="POST">

The cgi script may need some modifications to decode the data... here is the routine I use in my scripts:

read(STDIN, $input, $ENV{"CONTENT_LENGTH"});
@holder = split(/&/, $input);
foreach $pair (@holder) {
($name, $value) = split(/=/, $pair, 2);

$value =~ s/\+/ /g;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/\r\n/\n/g;
$value =~ s/\r/\n/g;

$name =~ s/\+/ /g;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ s/\r\n/\n/g;
$name =~ s/\r/\n/g;


You end up with a hash (associative array) that contains the data.

For example, if you have form inputs including "name", "email", and "telephone", you would access these in your cgi script with the following variables:



Featured Threads

Hot Threads This Week

Hot Threads This Month