Hi all
I have just completed a php/MySQL website:
http://www.limerickrocks.ie
As a finishing touch I wanted to ad in a counter that I had coded in an older website (pre PHP 5).
The code was as follows:
session_start();
if(!session_is_registered('click')){
$serverdate = date("l, d m h:i a");
$output= $_SERVER['HTTP_REFERER'];
$agent= $_SERVER['HTTP_USER_AGENT'];
include "connections.php";
mysql_connect($DBhost,$DBuser,$DBpass);
mysql_select_db("$DBName");
$result = mysql_query("SELECT * FROM `count` WHERE id_count = 1");
$click = mysql_result($result,0,"click");
$click+=1;
mysql_query("UPDATE `count` SET click=$click WHERE id_count=1");
mysql_query("INSERT INTO `count` (click, id_count, camefrom, agent, time) VALUES ('$click', '$id_count', '$output', '$agent','$serverdate')");
session_register('click');
}
The problem is that the server uses php5 and it gives me the following message when I go to the page:
Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
The Thing is that the counter works fine so I would kinda like to leave the code as is.
I dont have access to change the configuration of php on the server so I cant just turn the compatability warning off.
Whats the best way for me to get around this problem??
Any help greatly appreciated,
Beedge