Hey people,
Thanks in advance for your help.
ok..what im doing is making a small counter. The site has a hidden frame called hidden.php and that is where the counter is located. I take the http_referer, the ip address, and the time..and place it into a table.
Now it all works perfectly on my local server, which is run on appache. But on the remote server, which is IIS, everything goes to hell. The date works, the autoincrement works...but the getenv variables don't. I get blank fields in the database. Please someone help...i can't figure it out. Thanks..and here is the code:
// Connection information
$dbhost = "localhost";
$dbuser = "*****";
$dbpass = "*****";
$dbname = "f1bahrain";
// Connect to MySql
$connect = mysql_connect($dbhost, $dbuser, $dbpass)
or die("Unable to connect to MySql");
// Connect to Database
$db = mysql_select_db($dbname, $connect)
or die("Unable to connect to Database");
//get variables
if (getenv(HTTP_CLIENT_IP)){
$ip=getenv(HTTP_CLIENT_IP);
}
else {
$ip=getenv(REMOTE_ADDR);
}
$referer = getenv("HTTP_REFERER");
$time = date("r");
//Insert into table
$sql = "INSERT INTO counter (`id`, `ip`, `referer`, `time`) VALUES ('', '$ip', '$referer', '$time')";
$result = mysql_query($sql)
or die("Unable to run query");