PHP Redirection Script

Discussion in 'PHP' started by pkallberg21, Feb 2, 2008.

  1. #1
    I have tried numerous different approaches to removing the affiliate url from the status bar, none of which have worked. For example, I tried using a redirect.php file with this code:
    <?php
    $links = array(
    
          "aff1" => "<img src="http://xxxxx.com/imp.php?a=5775&b=6108&w=8128&p=323" width="0" height="0" /><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="728" height="90"><param name="movie" value="http://xxxxxx.com/video_casino_728_90.swf?SERVERADDRESS=http://xxxxxxxxx.com/tbm/SW/&LANG=SW&LINKNAME=clickTAG&clickTAG=http://xxxxxxxxx.com/click/a/5775/b/6108/w/8128/p/323/"><param name="quality" value="high"><embed src="http://xxxxxxxx.com/video_casino_728_90.swf?SERVERADDRESS=http://xxxxxxxxx.com/tbm/SW/&LANG=SW&LINKNAME=clickTAG&clickTAG=http://xxxxxxxxx.com/click/a/5775/b/6108/w/8128/p/323/" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="728" height="90"></embed></object>",
          "1" => "http://www.1.com",
          "2" => "http://www.2.com",
          "3" => "http://www.3.com"
          
          );
          
    header("Location:".$links[$_GET['site']]);
    exit;
    
    ?>
    Code (markup):
    However, as you can see the affiliate URL is rather long, and I am getting PHP parse errors. What can I do to fix this?

    Very thankful for any help!
     
    pkallberg21, Feb 2, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Remove the HTML. There's supposed to be just an URL, not an image.
     
    nico_swd, Feb 2, 2008 IP
  3. pkallberg21

    pkallberg21 Peon

    Messages:
    295
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes that is what I thought aswell, but that is the way the affiliate wants the link. Is there no way to work around this?
     
    pkallberg21, Feb 2, 2008 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    Let me rephrase your question to make sure I understand you right.

    You want to link to your affiliate, but don't want their link to be visible in the status bar when you hover over it with your mouse?

    If that's the case, do what I initially said. Put the just the URL in place of the current HTML code:
    
    <?php
    $links = array(
    
          "aff1" => "http://url-of-your-affiliate.com",
          "1" => "http://www.1.com",
          "2" => "http://www.2.com",
          "3" => "http://www.3.com"
          
          );
          
    header("Location: ".$links[$_GET['site']]);
    exit;
    
    ?>
    PHP:
    Now when you go to redirect.php?site=aff1 it'll redirect to your affiliate, but it'll show the redirect.php in your status bar.
     
    nico_swd, Feb 2, 2008 IP
  5. pkallberg21

    pkallberg21 Peon

    Messages:
    295
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The problem is that it is not merely a link that needs to be clicked on, there is a flash object that needs to be embedded, and that has to be linked to the affiliate.

    Sorry if I have been unclear, but I hope you will understand now.

    Thanks for your help :)
     
    pkallberg21, Feb 2, 2008 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    If I'm not mistaken, the links in Flash don't appear in the status bar?

    Or do you want to extract the link from the flash so you can link to their site without embedding the flash on your site?

    Sorry if I'm being slow, lol. But I still don't quite understand what you're trying to do.
     
    nico_swd, Feb 2, 2008 IP
  7. pkallberg21

    pkallberg21 Peon

    Messages:
    295
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I am not sure about what need to do. What I want is to hide the affiliate link ([h ttp://url/imp.php?a=57 75&b=6108&w=8128&p=323)

    But at the same time I need to get the flash object. This is the code my affiliate has given me, so I presume that I need to show that in some how.
    <img src="http://xxxxx.com/imp.php?a=5775&b=6108&w=8128&p=323" width="0" height="0" /><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="728" height="90"><param name="movie" value="http://xxxxxx.com/video_casino_728_90.swf?SERVERADDRESS=http://xxxxxxxxx.com/tbm/SW/&LANG=SW&LINKNAME=clickTAG&clickTAG=http://xxxxxxxxx.com/click/a/5775/b/6108/w/8128/p/323/"><param name="quality" value="high"><embed src="http://xxxxxxxx.com/video_casino_728_90.swf?SERVERADDRESS=http://xxxxxxxxx.com/tbm/SW/&LANG=SW&LINKNAME=clickTAG&clickTAG=http://xxxxxxxxx.com/click/a/5775/b/6108/w/8128/p/323/" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="728" height="90"></embed></object>
    Code (markup):
     
    pkallberg21, Feb 2, 2008 IP
  8. pkallberg21

    pkallberg21 Peon

    Messages:
    295
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Can anyone find a solution to this? What I need to do is to load the embedded flash object on my website, but at the same time hide the URL.
     
    pkallberg21, Mar 1, 2008 IP
  9. Wuiqed

    Wuiqed Well-Known Member

    Messages:
    110
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #9
    Either I'm misunderstanding you, or you have misunderstood the code, but the URL in <img src="http://xxxxx.com/imp.php?a=5775&b=6108&w=8128&p=323" width="0" height="0" /> won't show up in the status bar because it is an image, not a link. The only way someone would be able to see that URL is if they check your source code (and knew what they were looking for).
     
    Wuiqed, Mar 1, 2008 IP