Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
  • Unusual script request (In: Coding & Databases - PHP, ASP, Perl, etc.)
  • Featured Web Site Template

    Hundreds More at Free Site Templates.com!

    Web Site Partners
    Sponsored Links
    Jet City Software
     
    Whos Here ?
    There are 0 guests and 1 members in the forums right now.
    Reflects user activity within the last 5 minutes
    Moderator(s): Prowler, jcokos
    Member Message

    wickedmoon
    Joined: Eons Ago
    # Posts: 10

    View the profile for wickedmoon Send wickedmoon a private message

    Posted: 2004-Jun-27 16:05
    Edit Message Delete Message Reply to this message

    I'm trying to get the following frame redirect perl script to parse the following URL correctly:

    http://wickedmoon.com/cgi-bin/send.cgi?send=http://cardfountain.com/ecards/4thjuly229902/index.php?enm=1&aid=101711

    As it is there seems to be a problem with the = signs, ie '=1&aid=101711' gets cut off the end of the URL when it's parsed through the script.

    I need to use this script with other kinds of URLs too, all containing equal signs. Any ideas of what should be added to the script?

    Jason

    #!/usr/bin/perl
    ###############################################
    ## ##
    ## Frame Redirect v.1 ##
    ## ----------------------------------------- ##
    ## by Graeme (webmaster@cgi-scripting.com) ##
    ## http://www.CGI-Scripting.com ##
    ## ############################
    ## This version of Frame redirect is free, if anyone sold it to you ##
    ## please contact me. Please DO NOT remove any of the copyrights or ##
    ## links to our site, they keep this CGI free for everyone. ##
    ## ##
    ## (c) Copyright 2000 CGI Scripting ##
    ##################################################
    #######################

    # Look in the readme.txt file for help setting up this script

    $height = "50";
    $siteurl = "http://wickedmoon.com";
    $framelocation = "http://wickedmoon.com/chooseanothercard.html";


    ####################### DO NOT EDIT BELOW THIS LINE ######################

    @querypairs = split(/&/, $ENV{'QUERY_STRING'});
    foreach $querypair (@querypairs) {
    ($queryname, $queryvalue) = split(/=/, $querypair);
    $queryvalue =~ tr/+/ /;
    $queryvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $queryvalue =~ s/<([^>]n)*>//g;
    if ($QUERY{$queryname}) { $QUERY{$queryname} = $QUERY{$queryname}.",".$queryvalue; }
    else { $QUERY{$queryname} = $queryvalue; }
    }


    if ($QUERY{'send'}=~/http:/) {
    print "Content-type: text/htmlnn";
    print qq(<HTML>
    <HEAD>
    <TITLE>$QUERY{'send'}</TITLE>
    </HEAD>
    <FRAMESET FRAMEBORDER="0" ROWS="$height,*">
    <FRAME SRC="$framelocation" SCROLLING="NO">
    <FRAME SRC="$QUERY{'send'}">
    <NOFRAMES>
    <BODY>
    Viewing this page requires a browser capable of displaying frames.
    </BODY>
    </NOFRAMES>
    </FRAMESET>
    </HTML> );
    } else {
    print "Location: $siteurlnn";
    }
    exit;




    You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
    1. You have not yet logged in, or registered properly as a member
    2. You are a member, but no longer have posting rights.
    3. This is a private forum, for which you do not have permissions.

    If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

    If you cannot find this message, click here to Re-Send it.

    If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

    Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

    New posts Forum is locked
    © 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions