I am trying to set up a system where to link to my site as an affiliate, all you have to do is click
www.mysite.com/pals-xxxxxx (where xxxxxx is the affiliate id). I have set up .htaccess with a quick
Code:
RewriteEngine on
RewriteRule ^pals-(.*)$ affpass.php?a=$1
and then in my affpass.php I have
Code:
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
$theURL = getenv("HTTP_REFERER");
srand((double) microtime() * 1000000);
$aff = $_REQUEST['a'];
// redirect to the site now...
header("Refresh: 0; URL=http://newdestination.com/site=mysite&AID=".$aff);
function custom_die($error_msg)
{
// Nice tidy way of dying
// echo html_header("Unexpected Error");
// echo ss_template('error_die.tmpl', array('%error%' => $error_msg));
echo $error_msg;
// echo html_footer();
exit;
}
function generatePassword ($length = 8)
{
// start with a blank password
$password = "";
// define possible characters
$possible = "0123456789bcdfghjkmnpqrstvwxyz";
// set up a counter
$i = 0;
// add random characters to $password until $length is reached
while ($i < $length) {
// pick a random character from the possible ones
$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
// we don't want this character if it's already in the password
if (!strstr($password, $char)) {
$password .= $char;
$i++;
}
}
return $password;
}
?>
The affiliate ids are not passing. Any ideas why?