-
Hi all!
Ok, I'm not that deep into .cgi, so I'm in desperate need of some
help here!
I have a .cgi script which takes the user to an url selected from
a dropdown box. (this works fine).
But I would like to modify the script so that I don't have to type
in the whole url in the dropdown box.
Now the html is as follows:
option value="http://www.aruba2001.nl/pages/page01.htm"
option value="http://www.aruba2001.nl/pages/page02.htm"
option value="http://www.aruba2001.nl/pages/page03.htm"
As the beginning of the URL is always the same, I would like to know how can I modify the
script that it automatically adds "http://www.aruba2001.nl" to the url, so
that the values in the dropdown box are as follows:
option value="/pages/page01.htm"
option value="/pages/page02.htm"
option value="/pages/page03.htm"
This is the script:
#!/usr/bin/perl
# Receive info from Posting
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Process info from Posting
@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;
$INPUT{$name} = $value;
}
$link = $INPUT{'link'};
print ("Location: $link\n\n");
exit;
Thanx and Cheerz,
Rick
-
-
Hi Musicman,
Thanx for your reply! Somehow I get an Internal Server Error when I use your piece of code!?!
Any idea, cause I haven't ;-)
Cheerz,
Rick
-
Hi,
just omit the strange stuff in square brackets that the forum has added to my reply....
Musicman
-
He he :-)
Could guessed that one myself now you say! It works! Thanx dude!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|