请参阅下面给出的代码。自从过去 5 个小时以来,我一直在与这段代码作斗争,以了解为什么 isset() 将条件评估为假,如果值发布的正是它应该发布的内容。如果我取消注释行号。- 4,5,6,7,8 并将其余代码从第 1 行放入。10 到 28 我可以看到 POSTED 值。任何人都可以通过任何指导或建议对此提供帮助。我会很感激的。
<?php
include 'dbconnection.php';
include 'functions.php';
// var_dump($_POST); what happens when you uncomment this line?
//sec_session_start();
// $email = $_POST['logemail'];
// $password = $_POST['p'];
// echo $password;
// echo $email;
// Our custom secure way of starting a php session.
if(isset($_POST['logemail'], $_POST['p'])) {
$email = $_POST['logemail'];
$password = $_POST['p']; // The hashed password.
if(login($email, $password, $mysqli) === true) {
// Login success
//$url = 'mwq';
//echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
echo $password;
echo $email;
} else {
// Login failed
header('Location: login.php?error=1');
}
} else {
// The correct POST variables were not sent to this page.
echo 'Invalid Request Data Not POSTED';
}
?>