A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: CGI go URL

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    4
    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

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    print ("Location: http://www.aruba2001.nl$link\n\n");

    Musicman

  3. #3
    Junior Member
    Join Date
    Jun 2001
    Posts
    4
    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

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    just omit the strange stuff in square brackets that the forum has added to my reply....

    Musicman

  5. #5
    Junior Member
    Join Date
    Jun 2001
    Posts
    4
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center