Miss-Ruth Posted December 13, 2010 Share Posted December 13, 2010 When I turn register_global is turned off (register_argc_argv is also set to off), this script won't work. How can I have register_globals turned off and make this work for me. Any help is highly appreciated. <?php $bd_me = mysql_bd_meect("localhost","db_me","pw_me"); mysql_select_db("db_me"); $query =sprintf("SELECT * FROM db WHERE unamename = '%s' AND stus = 'Banned'", mysql_real_escape_string($uname)); $query_new = mysql_query($query); if(mysql_num_rows($query_new)) { $login = "Sorry."; echo($login); } else { $result=sprintf("SELECT * FROM db WHERE unamename = '%s' AND password ='%s'", mysql_real_escape_string($uname), mysql_real_escape_string($password)); $resultf = mysql_query($result); if(mysql_num_rows ($resultf) == 0) { $login = "Failed."; echo($login); } else { $row = mysql_fetch_array($result); $uname=$row['uname']; $password=$row['password']; $login = "$uname=" . $uname . "$password=" . $password . "Successful."; echo($login); } } ?> Is there any other settings that needs to be changed in the php.ini to make this code work while register_globals is turned off? Link to comment https://forums.phpfreaks.com/topic/221535-register_globals/ Share on other sites More sharing options...
AbraCadaver Posted December 13, 2010 Share Posted December 13, 2010 I'm assuming that you post a form to this? If so: $uname = $_POST['uname']; $password = $_POST['password']; Link to comment https://forums.phpfreaks.com/topic/221535-register_globals/#findComment-1146775 Share on other sites More sharing options...
Miss-Ruth Posted December 13, 2010 Author Share Posted December 13, 2010 Yep! That worked. Thanks AbraCadaver. Ruth. Link to comment https://forums.phpfreaks.com/topic/221535-register_globals/#findComment-1146780 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.