Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-06-2010, 08:11 PM   PM User | #1
boogily
Regular Coder

 
boogily's Avatar
 
Join Date: Jul 2009
Posts: 275
Thanks: 18
Thanked 4 Times in 4 Posts
boogily is an unknown quantity at this point
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"
boogily is offline   Reply With Quote
Old 10-07-2010, 12:19 AM   PM User | #2
boogily
Regular Coder

 
boogily's Avatar
 
Join Date: Jul 2009
Posts: 275
Thanks: 18
Thanked 4 Times in 4 Posts
boogily is an unknown quantity at this point
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"
boogily is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:58 AM.


Advertisement
Log in to turn off these ads.