Jump to content

unknown error


subhomoy

Recommended Posts

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

Archived

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

×
×
  • Create New...

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.