Okay, I've searched here and on php.net and read several of the post on this issue and am still not clear as to what I need to do. I just had my sysadmin upgrade me to the latest and "greatest" versions of PHP and mySQL. Now, I'm getting the infamous warning:
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
Here's my offending script:
<?php
session_start();
header("Cache-control: private");
include("connectdb.php");
$locksql = "LOCK TABLES users READ";
$lockreq = mysql_query($locksql) or die("Couldn't execute lock: $locksql\n");
$userADS = addslashes($_POST['user']);
if (isset($_POST['user']) AND isset($_POST['pass'])) {
$passwd = md5($_POST['pass']);
$sql = "SELECT * FROM users WHERE username='".$userADS."' AND password='".$passwd."' LIMIT 1";
} else {
include("index.php");
}
$result = mysql_query($sql,$dblink) or die("Couldn't execute query<br>$sql\n");
$numrows = 0;
while ($row = mysql_fetch_array($result)) {
$numrows++;
$_SESSION['id'] = $row['id'];
$_SESSION['user'] = $row['username'];
$_SESSION['pass'] = $row['password'];
$_SESSION['name'] = $row['firstname']." ".$row['lastname'];
$_SESSION['email'] = $row['email'];
$_SESSION['sch'] = $row['school'];
$_SESSION['admin'] = $row['admin'];
$_SESSION['memo'] = $row['memo'];
$_SESSION['sport'] = $row['sports'];
$_SESSION['lunch'] = $row['lunch'];
$_SESSION['page'] = $row['page'];
$_SESSION['Llog'] = $row['last_login'];
$_SESSION['login'] = "YES";
$_SESSION['error'] = "";
$_SESSION['addr'] = md5($_SERVER['REMOTE_ADDR']);
include("GETbrowser.inc");
$_SESSION['browse'] = $Browser.":".$OS;
}
$locksql = "UNLOCK TABLES";
$lockreq = mysql_query($locksql) or die("Couldn't execute unlock: $locksql\n");
mysql_close ($dblink);
if ($numrows > 0) {
include("welcome.php");
} else {
$error = "<p class=\"error\">Invalid User Name or Password.<br />Please try again.</p>\n";
include("index.php");
}
?>
I've looked at it until I've gotten a migraine. Can anyone give me any ideas how to "fix" this? This message will really confuse my teachers so I need to get it off if I can.