dongyange1101 2016-02-09 14:06
浏览 263
已采纳

echo函数未显示任何输出

<?php
session_start();

if (isset($_POST["user_name"]) && isset($_POST["user_pwd"])) {
    include"php/connect_to_mysql.php";
    $user_name = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["user_name"]);
    $user_pwd = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["user_pwd"]);

    $sql = "SELECT * FROM user_ac WHERE user='$user_name' OR email='$user_name' AND pwd='$user_pwd' LIMIT 1";
    $result = mysqli_query($myConnection, $sql);

    if (mysqli_num_rows($result) > 0) {
        echo "Successfully Logged In";
        header("location: login.html?abc=234");
    } else {

    }
} else {

}    

In this code, inside the second if statement, echo is not displaying anything, but the header function executes correctly.

Please help, thanks.

  • 写回答

2条回答 默认 最新

  • dounuo8797 2016-02-09 14:10
    关注

    You cannot see the echo because you are going to another page.

    As test, remove the header("location: login.html?abc=234"); and you will see the echo.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 韩国网站购物,KG支付的支付回调如何解决
  • ¥15 workstation导入ovf文件,报错,怎么解决呢?
  • ¥15 关于#c语言#的问题:构成555单稳态触发器,采用LED指示灯延时时间,对延时时间进行测量并显示(如楼道声控延时灯)需要Proteus仿真图和C语言代码
  • ¥15 workstation加载centos进入emergency模式,查看日志报警如图,怎样解决呢?
  • ¥50 如何用单纯形法寻优不能精准找不到给定的参数,并联机构误差识别,给定误差有7个?matlab
  • ¥15 workstation加载centos进入emergency模式,查看日志报警如图,没有XFS,怎样解决呢?
  • ¥15 应用商店如何检测在架应用内容是否违规?
  • ¥15 Ubuntu系统配置PX4
  • ¥50 nw.js调用activex
  • ¥15 数据库获取信息反馈出错,直接查询了ref字段并且还使用了User文档的_id而不是自己的