Using Subids With Cloaked Affiliate Links

Status
Not open for further replies.

Entrep

Kiwi
Jul 25, 2006
277
4
0
New Zealand
I am sure that many of you have seen the following cloaking code for affiliate links:

PHP:
<?
} else {
  $a = $_REQUEST['a'];
  if ($a == 1) {
    header("Location: http://www.azoogle1.com?sub=");
    exit;
  }
  if ($a == 2) {
    header("Location: http://www.azoogle2.com?sub=");
    exit;
  }
  if ($a == 3) {
    header("Location: http://www.azoogle2.com?sub=");
    exit;
  }
}
?>

You then call each link you want by http://www.pathto.com/script.php?a=1 etc.

My problem is that I want to be able to alter the subid of each URL from the calling URL. So that calling something like this http://www.pathto.com/script.php?a=1?sub=XXXXXX would automatically go to http://www.azoogle1.com?sub=XXXXXX and http://www.pathto.com/script.php?a=2?sub=YYYY would automatically go to http://www.azoogle2.com?sub=YYYY etc.

Willing to pay for anyone who can help me do this, I am sure it is quite simple.

Cheers, Matt.
 


Code:
<?
} else {
  $a = $_REQUEST['a'];
  $subid = [/COLOR][COLOR=White]$_REQUEST['subid'];[/COLOR]
[COLOR=White]  if ($a == 1) {
    header("Location: http://www.azoogle1.com?sub=" . $subid . "");
    exit;
  }
  if ($a == 2) {
    header("Location: http://www.azoogle2.com?sub=[/COLOR][COLOR=White]" . $subid . ""[/COLOR][COLOR=White]);
    exit;
  }
  if ($a == 3) {
    header("Location: http://www.azoogle2.com?sub=[/COLOR][COLOR=White]" . $subid . ""[/COLOR][COLOR=White]);
    exit;
  }
}
?>  [/COLOR]
I'm assuming you know your azoogle links are incorrect, but this should help you figure it out. The proper format of your link will now be:

http://www.pathto.com/script.php?a=1&subid=XXXX
 
Last edited:
The last post was fucked up. Here it is again.



<?
} else {
$a = $_REQUEST['a'];
$subid =
$_REQUEST['subid'];
if ($a == 1) {
header("Location: http://www.azoogle1.com?sub=" . $subid . "");
exit;
}
if ($a == 2) {
header("Location: http://www.azoogle2.com?sub=
" . $subid . "");
exit;
}
if ($a == 3) {
header("Location: http://www.azoogle2.com?sub=
" . $subid . "");
exit;
}
}
?>



I'm assuming you know your azoogle links are incorrect, but this should help you figure it out. The proper format of your link will now be:

http://www.pathto.com/script.php?a=1&subid=XXXX
 
My subs are like this:

20_nameofsite
21_nameofsite

And so on... Does that make any difference to the code? Currently it seems to be passing on the nameofsite bit, but not the number.

Cheers, Matt.
 
That shouldn't cause any problem. Post back with more details of what's going on, possibly an example also.
 
Hey there, I sorted i thanks, I just removed the _ seperating the 2 different variables in the subids. Not sure what the problem is, but I'a away laughing now.

Many thanks!
 
You're welcome. Still unsure what the _ is all about, but whatever. You could even use something like ZZ to separate the number and letter, that way you can throw the subids into a spreadsheet and delimit by the ZZ or whatever you choose. Glad you got it fixed though.
 
Status
Not open for further replies.