weixin_33725272 2018-03-01 23:05 采纳率: 0%
浏览 23

header()自动移动我

AJAX:

$.ajax(
                {
                    type: "POST",
                    url: "validate.php",
                    data: {password: password},
                    success:
                    function(data)
                    {
                        if(data == "1")
                        {
                            alert("password c.");
                            var header = "<?php header('Location: administration.php'); ?>";
                            alert(header);
                        }
                        else
                        {
                            alert("password - inc.");
                        }
                    }
                });

validate.php:

<?php
if(isset($_POST["password"]))
{
    $password = $_POST["password"];

    if($password == "0000")
    {
        echo("1");
    }
    else
    {
        echo("0");
    }
}

?>

If I want to back from administration.php to index.php, function header() moves me to the index automatically. Why? How do I make a move only when my password is entered? So the password has to be entered even if I move from administration.php to index.php.

  • 写回答

0条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥30 如何降低hdfs中datanode的JVM内存用量
      • ¥20 SQL数据查询,子查询
      • ¥15 c++字符串分割问题
      • ¥15 vue+uniapp
      • ¥15 android freedom
      • ¥15 使用自定义的类型代替内置类型可行吗
      • ¥15 关于STM32的SPI和ENDAT接口编码器通信的问题
      • ¥15 关于#pdfbox#生成的PDF文件正常,转图片中文乱码的问题,如何解决?
      • ¥15 ADS中有关DAC控件的使用问题
      • ¥15 win11如何运行geoserver