I'm having a little problem with a little piece of code. I have a stats system in place of the header to record information about my visitors.
Now this might look fine and that there is nothing wrong with it but for some reason and only in Internet Explorer browsers it die's and does not record the information.
I would like to improve my code in any way possible so that this doesn't happen again.
Question
seb86
I'm having a little problem with a little piece of code. I have a stats system in place of the header to record information about my visitors.
Now this might look fine and that there is nothing wrong with it but for some reason and only in Internet Explorer browsers it die's and does not record the information.
I would like to improve my code in any way possible so that this doesn't happen again.
Here is my code that I have at the moment.
// Record stats log $requestURL = $_SERVER['REQUEST_URI']; $requestURL = str_replace("'", "'", $requestURL); if($session->logged_in){ $q = "INSERT INTO ".TBL_STATS." (stats_id, ip_guest, ip_user, language, agent, referer, url, username, last_login, last_visit) VALUES ('".mysql_insert_id()."', '', '".$_SERVER[REMOTE_ADDR]."', '".$_SERVER['HTTP_ACCEPT_LANGUAGE']."', '".$_SERVER['HTTP_USER_AGENT']."', '".$_SERVER['HTTP_REFERER']."', '".$requestURL."', '{$session->username}', '".date("Y-m-d H:i:s")."', '')"; } else{ $q = "INSERT INTO ".TBL_STATS." (stats_id, ip_guest, language, agent, referer, url, username, last_visit) VALUES ('".mysql_insert_id()."', '".$_SERVER[REMOTE_ADDR]."', '".$_SERVER['HTTP_ACCEPT_LANGUAGE']."', '".$_SERVER['HTTP_USER_AGENT']."', '".$_SERVER['HTTP_REFERER']."', '".$requestURL."', 'guest', '".date("Y-m-d H:i:s")."')"; } mysql_query($q) or die("ERROR: ".mysql_error());Any help would be most appreciated.
Thank you.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts