Ok so I am trying to make it so users can refer others using the domainname followed by their username.
My site works using Iframes so index.php actually loads home.php in an iframe, where a new user can enter their details, upon which they are submitted to the database.
In index.php I have:
<?php
session_start();
$ref = $_SERVER['HTTP_REFERER'];
$_SESSION['abc'] = $ref;
?>
A user then enters their info and submits in which home.php adds them to the database. Home.php has the follwing code:
session_start(); //at the top of the file followed by some other code
//If they are a new users. lets say they clicked a referral link in which 'referredby' would show domainname.com/referrerUserName
if (isset($_SESSION['abc'])) {
//insert new user
$run = mysql_query("INSERT INTO ".MYSQLTABLE."(id, address, ip, date, time, referredby) VALUES('','" . $_POST['address'] . "','" . $_SERVER['REMOTE_ADDR'] . "', '".date("Y-m-d")."', '".date("D")."', '".$_SESSION['abc']."')");
}
else {
echo 'error';
}
They are added ok but in the 'referredby' column this is returned: http://domainname.com/screens.css When it should show http://domainname.com/?r=ReferrersUserName
Any help would be great! Yes I will be changing to SQLI