Results 1 to 4 of 4

Thread: session unknown error ... [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    74

    session unknown error ... [RESOLVED]

    hello I am getting an 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


    what is this error?


    the code that I use is this:

    PHP Code:

    <?
        $username = $_POST['username'];
        $password = $_POST['password'];
        $result = mysql_query("SELECT * FROM admin",$mysql_link) ;
        $isAuth = false;                                            //set to false originally
        while($row = mysql_fetch_array($result))
        {
            if($row['Name'] === $username && $row['Pass']===$password)                      //above row checks to see if username/password combination exists
            {
                $isAuth = true;
                session_start();
                session_register('username');
            }
        }
        if($isAuth)
        {
            print "logged in successfully<br>";
            print "<A href='index.php'>Go to Admin Panel</a>";
        }
        else                                                        //if login/pass does not exist
        {
            header("Location: wrong-url.com");
        }
    ?>
    <html>
    <head>
         <META NAME="Author" CONTENT="Yair Ben Ari">
         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8-i">    
         <Link REL=STYLESHEET HREF="style.css" TYPE="text/css">
         <title>login</title>
    </head>
    <BODY>
    <?
        if($isAuth)
        {
            include('header.php');
            include('adminmenu.inc');
        }
    ?>
    is it a deprecated code? what can I do to fix it?
    I read that I should use this:

    PHP Code:
    $_SESSION['var'] = 'something'
    unset(
    $_SESSION['var2']); 
    instead of the way I use session_register...
    but how can I use it in this code can someone help please?

    Yair
    Last edited by yair24; Sep 15th, 2003 at 01:44 AM.
    -------------------------------------
    http://www.ybweb.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width