hello I am getting an error:
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
what is this error?
the code that I use is this:
is it a deprecated code? what can I do to fix it?PHP Code:
<?
$username = $_POST['username'];
$password = $_POST['password'];
$result = mysql_query("SELECT * FROM admin",$mysql_link) ;
$isAuth = false; //set to false originally
while($row = mysql_fetch_array($result))
{
if($row['Name'] === $username && $row['Pass']===$password) //above row checks to see if username/password combination exists
{
$isAuth = true;
session_start();
session_register('username');
}
}
if($isAuth)
{
print "logged in successfully<br>";
print "<A href='index.php'>Go to Admin Panel</a>";
}
else //if login/pass does not exist
{
header("Location: wrong-url.com");
}
?>
<html>
<head>
<META NAME="Author" CONTENT="Yair Ben Ari">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8-i">
<Link REL=STYLESHEET HREF="style.css" TYPE="text/css">
<title>login</title>
</head>
<BODY>
<?
if($isAuth)
{
include('header.php');
include('adminmenu.inc');
}
?>
I read that I should use this:
instead of the way I use session_register...PHP Code:$_SESSION['var'] = 'something';
unset($_SESSION['var2']);
but how can I use it in this code can someone help please?
Yair




Reply With Quote