Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: php redirect issue

  1. #1
    gotdmw is offline Newbie
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

    php redirect issue

    below is a Full page Iframe to display the offer URL and prevent bots from following the link to the final destination URL

    the problem is it directs to r-decode.php which is a code that masks the url somehow, and is striping my tracking.

    why is it killing my tracking?

    how could i just bypass r-decode.php and go to another file?

    if one of u scholars can tell me how to do this be much appreciated.

    Code:
    <?php
    $offerURL 
    "http://www.hostgatorxcom/";//put your offer's affiliate jump link here

    $offerURL trim($offerURL);//do not edit this line
    $thisRedirectUrl base64_encode($offerURL);//do not edit this line
    $thisRedirectUrl "r-decode.php?{$thisRedirectUrl}";//do not edit this line
    ?>
    Last edited by James.H; 03-07-2010 at 05:42 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,082
    Blog Entries
    7
    Rep Power
    42

    Re: php redirect issue

    Everything depends on how r-decode is built up, and how $thisRedirectUrl is used in your code.
    __________________________________________
    I study Information Systems at Karlstad University when I'm not on CodeCall

  4. #3
    Jaan Guest

    Re: php redirect issue

    Yea, can you show us that r-decode.php file ?

  5. #4
    gotdmw is offline Newbie
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

    Re: php redirect issue

    thx for replies

    this is the bottom of the php code, so i guess this is what $thisRedirectUrl is used for

    Code:
    ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>

    <head>
      <title>Edit Me</title>
    <META name="description" content="">
    <META name="keywords" content="">
    </head>
    <frameset rows="100%,*" border="0">
      <frame src="<? echo $thisRedirectUrl?>" frameborder="0" />
      <frame src="UntitledFrame-2" frameborder="0" noresize />

      <noframes>
        Put content here...
        
      </noframes>

    </frameset>

    </html>
    and here is the r-decode.php

    Code:
    <?php
    // Note: there's no need to modify this file. Just upload it to your server along with the iframe file.
    // this file redirects the user to your link while hiding the refer information from the destination URL


    $thisReferringUrl = @$_SERVER["HTTP_REFERER"];//use default in case the requested url is invalid
    $clientIPNumber = @$_SERVER["REMOTE_ADDR"];
    $clitentBrowserUserAgent = @$_SERVER["HTTP_USER_AGENT"];

    if (empty(
    $clitentBrowserUserAgent)){
        
    //no useragent means it's a bot
        
    header("HTTP/1.0 301 Permanent Redirect");
        
    header("Location: http://127.0.0.1",true,301);
        exit;
    }

    $topMargin rand(10,111);
    $thisRedirectUrl null;


    $imagePropertiesArr = array();
    if (!empty(
    $imagesArr)){
        
    $rand_key array_rand($imagesArr1);
        
    $imageProperties $imagesArr[$rand_key];
        
    $imagePropertiesArr explode("|",$imageProperties);
    }

    $url_encoded = @$_SERVER["QUERY_STRING"];
    if (!empty(
    $url_encoded)){
        
    $url_encoded trim($url_encoded);
        
    $url_decoded base64_decode($url_encoded);
        if (
    checkValidURL($url_decoded)){
            
    $thisRedirectUrl $url_decoded;
        }
    }


    function 
    checkValidURL($siteurl){
        
    $siteurl trim($siteurl);
        
    $siteurlVal $siteurl;
        
    $siteurlVal ereg_replace("[^a-zA-Z0-9?:=,;@#$|&+%\/._-]"""$siteurlVal);//strip out invalid chars
        
    if ($siteurl != $siteurlVal) return  false;
        if(
    ereg("^http://.+\\..+$"$siteurl) || ereg("^https://.+\\..+$"$siteurl))
            return 
    true;
        else
            return 
    false;
    }

    if (empty(
    $thisRedirectUrl)){

        
    header("HTTP/1.1 404");
        
    header("Location: 404");
        exit;
    }





    //echo $thisRedirectUrl;
    //exit;


    //header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
    //header("Pragma: no-cache");
    //header("HTTP/1.0 301 Permanent Redirect");
    ?><html>
    <head>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="refresh" content="0;url=<? echo $thisRedirectUrl?>" />
    </head>
    <body>
    <script language="JavaScript" type="text/javascript">
    function go(){
        document.location.href="<? echo $thisRedirectUrl?>";
    }
    setTimeout ('go()', 1);
    </script>
    </body>
    </html>
    Last edited by Orjan; 03-07-2010 at 12:34 PM. Reason: Please use code tags!

  6. #5
    gotdmw is offline Newbie
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

    Re: php redirect issue

    can i take the out r-decode somehow?

    is there a way to do this but not blank to referrer everything comes up blank in tracking?

  7. #6
    gotdmw is offline Newbie
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

    Re: php redirect issue

    well i got the tracking to work,

    but this code is blanking the refferrer, which i do not want it to do.

    does anybody know how to cure this?

    thx

  8. #7
    Jaan Guest

    Re: php redirect issue

    Code:
     <?php 
    $offerURL 
    "http://www.hostgatorxcom/";//put your offer's affiliate jump link here 

    $offerURL trim($offerURL);//do not edit this line 
    $thisRedirectUrl base64_encode($offerURL);//do not edit this line 
    $thisRedirectUrl "r-decode.php?{$thisRedirectUrl}";//do not edit this line 
    ?>
    This
    Code:
    $thisRedirectUrl "r-decode.php?{$thisRedirectUrl}";//do not edit this line 
    Is gonna be something like this:
    ?

    If you want it to work like this then http://www.hostgatorxcom must be defined in your code..
    so..

    Code:
    if($_GET['http://www.hostgatorxcom']){

    // do somethign


    I guess it's missing something like ?url=

    And your redirect address would be:

    r-decode.php?url=http://www.hostgatorxcom/
    Then it should be like this in your file:
    Code:
    if($_GET['url'] == "http://www.hostgatorxcom/"){

    // do something


    Or something like that..

  9. #8
    gotdmw is offline Newbie
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

    Re: php redirect issue

    how can i keep the i frame but lose the r-decode, just shoot it to another domain?

    or do i have to have that?

  10. #9
    Jaan Guest

    Re: php redirect issue

    I guess you have to build a new file for it or.. just yea redirect them directly to another site..

  11. #10
    gotdmw is offline Newbie
    Join Date
    Mar 2010
    Posts
    6
    Rep Power
    0

    Re: php redirect issue

    yeah i would just want to hit the iframe page then redirect from that page to another url.

    does this look like it would work?

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help With PHP Redirect....Easy I Think??
    By kylel in forum PHP Development
    Replies: 5
    Last Post: 05-11-2011, 11:44 AM
  2. htaccess redirect
    By alix in forum PHP Development
    Replies: 15
    Last Post: 04-04-2011, 10:02 AM
  3. Login Redirect..?
    By aakinn in forum PHP Development
    Replies: 2
    Last Post: 12-30-2010, 05:37 AM
  4. Replies: 1
    Last Post: 09-15-2010, 03:15 PM
  5. Domain Redirect!!! HELP!!
    By TheCEOandPresident in forum General Programming
    Replies: 10
    Last Post: 01-22-2009, 08:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts