View Single Post
Old 10-26-2006, 11:24 PM  
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by borked View Post
it depends how the session id is passed in the URL...

eg
index.php?sid=<sessionid>
then your session variable name is 'sid'

I'm guessing the session id is the 'referralCode', in which case:

Code:
function check_sess($sid, $refCode) {
  if ($sid) {
    if($sid == $refCode) return TRUE;
    else return FALSE;
  }else return FALSE;
}

// check session and give link
if(check_sess($_GET['sid'])) print"<referral code link here>";
else print"<non-referred link>";
not sure if that's what you were after!
Why not just:

Code:
echo empty($_REQUEST[sid']) ? 'foo' : 'bar';
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote