homepage Welcome to WebmasterWorld Guest from 23.20.77.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Marketing and Biz Dev / Cloaking
Forum Library, Charter, Moderator: open

Cloaking Forum

    
browser location bar
altering what is shown in the location bar
naj




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

Hi,
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.
Thanks

 

Brett_Tabke




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

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

volatilegx




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

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:

if ($ENV{'REQUEST_METHOD'} eq "POST") {
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;

$fields{$name}=$value;
}
}

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:

$fields{'name'}
$fields{'email'}
$fields{'telephone'}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Marketing and Biz Dev / Cloaking
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved