Why can I jump to the page if I enter the verification code incorrectly?
晚上记得要刷牙
晚上记得要刷牙 2018-03-15 23:59:08
0
2
1296

session_start();

header('Content-type:text/html;charset=utf-8');

$code = $_POST["code"]; //Verification code

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

if (empty($_POST['username '])){

echo "";

}else {

using using using using using ’s ’ ’s ’ using using ‐ ‐ ‐ $username=$_POST['username'];

# echo "";

}else{

$password=$_POST['password'];

}

}

if($code != $_SESSION['authcode']) //Determine whether the filled-in verification code matches the information generated by the verification code PHP file


{

echo "";

}

$ mysqli = new mysqli('localhost', 'root', 'root', 'user');


$result = $mysqli->query("SELECT password FROM user WHERE username = "."' $username'");

$rs=$result->fetch_row();

if (!empty($rs)){

if ($password != $rs[0]) {

echo "";

}else{

$expire=3600;

ini_set('session .gc_maxlifetime', $expire);//Save for 1 hour

if (empty($_COOKIE['PHPSESSID'])) {

session_set_cookie_params($expire);

session_start();

}else{

session_start();

setcookie('PHPSESSID', session_id(), time() $expire);

}

iF (isset ($ _ session ['username'])) {

Header ("local: index.html");

##} else {

use with $_SESSION['username']=$_POST[''];
";

echo "Hello! {$_SESSION['username']}, welcome back!";

echo "Logout" ;

}

}else{

echo "";

added after return

    sky

    Don’t use so many ifs when writing code without truncation

      Popular Topics
      More>
      Popular Articles
      Popular Tutorials
      More>
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!