开发者

lost session after Header redirect

开发者 https://www.devze.com 2022-12-25 08:30 出处:网络
session_start(); //login page if(mysql_num_rows($result) != \'0开发者_高级运维\'){ // If match.
 session_start();
//login page
if(mysql_num_rows($result) != '0开发者_高级运维'){ // If match.

        session_register("username"); // Craete session username.

        header("location:admin/admin.php"); // Re-direct to admin.php    
    exit;

    }else{ // If not match.

        $message="Please Incorrect your account !";

    }

//After login successfully go to admin.php

session_start();

echo $_SESSION['username'];


try setting the variable:

if (mysql_num_rows($result)) {
    $_SESSION['username'] = "something";
    header(....); exit;
} // etc
0

精彩评论

暂无评论...
验证码 换一张
取 消