ugh... php redirect ? again... (sorry)

Status
Not open for further replies.

trigatch4

BuildAndEarn
Aug 23, 2006
2,557
79
0
East Coast
www.eurekadiary.com
Using php redirects for llinking to affiliate offers, I've seen a couple solutions for "cloaking". I'm looking for one that I can't find the details of now.

Originially I was just linking to a specific .php file and using a redirect for every single offer but someone offered a solution where you could either use one PHP file for all the redirects or put it in the .htaccess

So somehow it would just be like

CODE HERE
mysite.com/offer1.php >goes to> www.affiliatesite.com/offer92884
mysite.com/offer1.php >goes to> www.affiliatesite.com/offer23452

And just have it all listed in one convenient location for creating/editing/referring

Anyone?
 


here is my edited verison of the advanced link posted in the thread nogenius linked above.

Code:
<?
$m = $_GET['m'];
$type = $_GET['type'];

 if ($m == "id")
    {$jumplink= "http://affiliatelink.net";}

 if ($m == "id")
    {$jumplink= "http://affiliatelink.net";}
    

header("Location: $jumplink");
?>

then you just link it by http://www.yourdomain.com/link.php?m=ID

where link.php is the name of the php file u saved the above code as

i had to modify the end in comparison to the advanced on posted cuz it wasnt workin for me
 
I've been looking at this and the ShortURL plugin for WP. I'm going to try to add something like
Code:
 RewriteRule ^redirect/([0-9]+)$ redirect.php?$1
to see if that make the URL's pretty for this script. Also what needs to be done to make this use a database? It seems awfully time consuming having to always go edit and upload a file daily. thanks again.
 
I've been looking at this and the ShortURL plugin for WP. I'm going to try to add something like
Code:
 RewriteRule ^redirect/([0-9]+)$ redirect.php?$1
to see if that make the URL's pretty for this script. Also what needs to be done to make this use a database? It seems awfully time consuming having to always go edit and upload a file daily. thanks again.

If you end up setting something like what you mention up, a URL like:

http://www.mysite.com/redirect/myaffiliate

Would go to:

http://www.mysite.com/redirect.php?myaffiliate

If you have that setup, you can basically do anything you want in redirect.php to accomplish what you want. In redirect.php, you can query your database for the latest affiliate offers and redirect automatically.

I don't know if that makes any sense, but basically you can create any kind of creative database offer setup you want in redirect.php and simply trigger each one by the variable you pass in...
 
Status
Not open for further replies.