I'm still having problems with this, I have striped out everything from the script to see if I can just get this bit working but I'm still having no luck. It just seems strange to me that if I type the url in and then refresh the page everything seems to work ok!?
Here is the code I’m using:
<?php
session_start();
// see if this is a unique hit or not
if(!$counted) {
$hitunique = "1";
$_SESSION["counted"] = "yes";
}
else{
$hitunique = "0"; // not unique
}
// connect to the database
include('connectdb.php');
// save main data to table
$sql = "INSERT INTO fstat_autocount (id, time, referer, page, browser, os, language, hitunique, member, domain) VALUES ('','-','-','-','-','-','-','$hitunique','-','-')";
$result = mysql_query($sql);
exit;
?>
And this is what im calling it with:
<img src="http://www.domain.co.uk/folder/script.php">
One thing I did notice is that i was getting server variables like http_user_agent and they were shown as the variables from the page that calls the script. Does this mean my script is trying to set variables on the originating site and not the site the script runs from? I know its server-side and so shouldn’t matter, but I’m getting confused as to why its not working.
Any ideas?
Shatner