Re: PHP Error - "Warning"
i'm not completely sure what it means, but i gather that you're using a method that isn't used anymore, and seems to rely on register_globals being enabled.
post the code you're using.
Re: PHP Error - "Warning"
Here is what it on the "auto login" page
PHP Code:
<?PHP
$logged_in_admin = "dclamp";
session_register("logged_in_admin");
?>
Here is the actual login code:
PHP Code:
<?PHP
$links = "<A HREF='main.php'>Click here to proceed to the main page</A><BR>
You Will Be Redirected In 2 Seconds.<br>
<META HTTP-EQUIV='refresh' content='2;URL=http://www.homtek.net/admin/main.php'>";
if ($admin && $pass) {
if ($logged_in_admin == $admin) {
echo $admin.", you are already logged in.<BR><BR>";
echo $links;
exit;
}
$result = mysql_query("SELECT * FROM admin_login WHERE username = '".$admin."'
AND password = PASSWORD('".$pass."')");
if (!$result) {
echo "Sorry, there has been an error. Please try again, or contact technical support.";
exit;
}
if (mysql_num_rows($result) > 0) {
$logged_in_admin = $admin;
session_register("logged_in_admin");
echo "Welcome, ".$logged_in_admin.". <BR><BR>";
echo $links;
exit;
} else {
echo "<font color=red>Invalid login. Please try again.</font><BR><BR>";
}
} else if ($admin || $pass) {
echo "<font color=red>Please fill in both fields.</font><BR><BR>";
}
?>
<FORM METHOD=POST ACTION="login.php">
Your username:
<INPUT NAME="admin" TYPE=TEXT MAXLENGTH=20 SIZE=20>
<BR>
Your password:
<INPUT NAME="pass" TYPE=PASSWORD MAXLENGTH=10 SIZE=10>
<BR>
<INPUT TYPE=SUBMIT VALUE="Login">
</FORM>