Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder boogily's Avatar
    Join Date
    Jul 2009
    Posts
    275
    Thanks
    18
    Thanked 4 Times in 4 Posts

    Passing affiliate variables from user through .htacess to php then redirect

    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?
    Joomla Development Company and MN SEO
    "Joomla development from design to SEO"

  • #2
    Regular Coder boogily's Avatar
    Join Date
    Jul 2009
    Posts
    275
    Thanks
    18
    Thanked 4 Times in 4 Posts
    Fixed, temporarily. The coding is correct. The affiliate program is being passed to just one product, and I am looking for one that goes to all products. COnsider this solved
    Joomla Development Company and MN SEO
    "Joomla development from design to SEO"


  •  

    Posting Permissions

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