View Single Post
Old 01-31-2013, 09:28 PM   PM User | #6
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,376
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
First let me ask you a question, does the site your putting this on give you access to mysql?

If user2 comes into your site with address that ends in ?refid=123 or some other number this code checks it and sets a cookie OR it see if as cookie exists and if yes reads it and puts into a session variable.

PHP Code:
<?php
session_start
;
 
$_SESSION["rewards"] = '';

if(isset(
$_GET['refid'])){
    
setcookie("njfailREWARDsystem"$_GET['refid'], time()+604800);

}else if(isset(
$_COOKIE["njfailREWARDsystem"])){
    
$value $_COOKIE["njfailREWARDsystem"];
    
$_SESSION["rewards"] = $value;
    echo 
$_SESSION["rewards"]; // ONLY here for show
}
?>
You should be having trouble with the code you published
, are you?

Last edited by sunfighter; 01-31-2013 at 09:52 PM..
sunfighter is offline   Reply With Quote
Users who have thanked sunfighter for this post:
njfail (01-31-2013)