【问题标题】:header location is not working, im stuck in the same page标题位置不起作用,我卡在同一页面中
【发布时间】:2017-02-03 22:52:49
【问题描述】:

嘿,我有这段代码,查询工作完全正常,但标题没有请帮助,这是我的代码,我很感激

<?php

 if (isset($_POST['login'])){

$username=$_POST['username'];
$pass=$_POST['password'];
$hashedpass=md5($pass);

$query="SELECT username, password FROM users WHERE username='$username' AND password='$hashedpass'";
echo $query;
$run=mysqli_query($con, $query);

$rows=mysqli_num_rows($run);

if ($rows > 0){
    $_SESSION['username'] = $username;
    header('Location: index.php');
    exit();
  }

}


?>
用户名 密码

【问题讨论】:

标签: mysqli header


【解决方案1】:

尝试编写完整的 uri 并删除退出 header('位置:http://www.domain/index.php');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-22
    • 2014-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多