PHP sessions are invalid. they cannot be written to any other files.
Incorrect account or password!";}}?>Background management page
The code above is very simple, but the SESSION has never been written. I don't know why !!
Reply to discussion (solution)
$ _ SESSION ['login _ status'] = "oko"; // The value is a = sign.
You have a try
Modified code
If (isset ($ _ POST ['sub']) {
Require "./config. php ";
If ($ _ POST ['login _ name'] = $ admin_name & $ _ POST ['login _ pwd'] = $ admin_pwd ){
$ _ SESSION ['login _ status'] = "oko"; // Here you have an additional "="
} Else {
Echo"Incorrect account or password!";
}
} Else {
Session_start (); // session_start (); run it once and put it at the beginning of the code.
}
?>
Background management page
If ($ _ SESSION ['login _ status']! = "Oko "){
Var_dump ($ _ SESSION ['login _ status']); // This location is always NULL.
?>
} Else {
Echo "ll ";
Var_dump ($ _ SESSION ['login _ status']); // print this location
}
?>
$ _ SESSION ['login _ status'] = "oko"; // The value is a = sign.
= No. Error
Okay, I admit it...