Jump to content


This topic is now archived and is closed to further replies.


register_globals off solution required

Recommended Posts

I had created a few php pages for my site which used register_globals as ON but the version of php has been updated at my server and i can no longer user register_globals to authenticate my login. Here is my code

form_login.php file contains this>>>
<form action="login.php" method=post>
<table border=0>
<td><input type=text name=login size=16></td>
<td><input type=password name=password size=16></td>
<td><a href="prepare_registr.php">REGISTER</a></td>
<td><input type=submit value=" login "></td>

login.php contains this >>>>>
include "header.php";


$rez = mysql_query("SELECT * FROM users WHERE u_login='$login' and u_password='$password'");
list($user["id"],$user["login"],$user["password"],$user[ "mail"],$user["ldate"],$user["fname"],$user["lname"])=mysql_fetch_row($rez);
mysql_query("UPDATE users SET u_ldate='$date' WHERE u_id='$id'");
header("location: index.php");
include "header1.php";
include "left.php";
?><center> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&n bsp&nbsp&nbsp&nbsp User not found <a href='form_login.php'>Try again</a><?

ALL OF THIS WORKS BUT THE AUTHENTICATION AFTER LOGIN TAKES PLACE in header1.php which is this >>>>>>>>>>>>>>>>

?><h3>Welcome <?
echo $user["login"];[/color]
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&n bsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&n bsp
<font color="red" ><a href=prepare_edit_user.php>Update Account</a>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&n bsp
<a href=logoff.php>LogOff</a></font></h3>

[font=Verdana]Since register_globals is off if($user=@$GLOBALS['user']){ never comes true and i cannot open my login pages...what other approach can i use to overcome this problem now?[/font]

Please Help

Thank You

Share this post

Link to post
Share on other sites
will u plz put your code in a code box its as ez as pressing a button or typeing [ code ] and [ /code ] without the spaces

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.