subhomoy Posted April 28, 2013 Share Posted April 28, 2013 Hii i'm seeing this 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 My login code is.... <?php if(isset($_REQUEST['submit'])){ $uname = mysql_real_escape_string(htmlentities($_REQUEST['uname'])); $pwd = mysql_real_escape_string(htmlentities($_REQUEST['pwd'])); $code = mysql_real_escape_string(htmlentities($_REQUEST['code'])); if($uname && $pwd && $code){ $result = mysql_query("SELECT * FROM users WHERE username='$uname' AND password='$pwd' AND code='$code'") or die(mysql_error()); while($row = mysql_fetch_array($result)){ $_SESSION['id'] = $row['id']; $_SESSION['name1'] = $row['name']; $uname1 = $row['username']; $pwd1 = $row['password']; $code1 = $row['code']; } if(($uname==$uname1) && ($pwd==$pwd1) && ($code==$code1)){ header("Location: members/home.php"); } else echo "<strong><center><font color='white'>Wrong Username or Password</font></center></strong>"; } else echo "<strong><center><font color='white'>Enter All The Fields</font></center></strong>"; } ?> after login when the home page is loaded on top shows the error... i've used this piece of code on top of every page to check whether a user is logged in or not... if(!$_SESSION['name1'])header("Location: index.php"); Any help will be greatly appreciated..... Link to comment https://forums.phpfreaks.com/topic/277383-unknown-error/ Share on other sites More sharing options...
wright67uk Posted April 28, 2013 Share Posted April 28, 2013 Have you started the session? Link to comment https://forums.phpfreaks.com/topic/277383-unknown-error/#findComment-1427003 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.