【问题标题】:Heliohost website deployment problem. not redirectingHeliohost网站部署问题。不重定向
【发布时间】:2021-03-08 00:24:32
【问题描述】:

我做了一个 php 网站。它具有登录机制。我能够上传它 Heliohost 但是当我登录到我的网络应用程序时,它没有重定向到它应该重定向的位置。可能是什么问题? [![在此处输入图片描述][1]][1]

这是登录 [1]:https://i.stack.imgur.com/SiOJP.png 当我登录时,它只是显示空白

000webhost 也是如此。登录页面出现,但我登录后,什么都没有发生。

【问题讨论】:

  • 我检查了网页。它说 Uncaught TypeError: Cannot read property 'fn' of undefined 然后它显示这一行 $.fn.emulateTransitionEnd = transitionEndEmulator
  • 再次检查。 警告:无法修改标头信息 - 标头已由 /storage/ssd1/324/ 中的(输出开始于 /storage/ssd1/324/15495324/public_html/index.php:8)发送15495324/public_html/resource/backend.php36 行
  • 如果您搜索该警告错误消息,您会发现很多类似的问题。但是,通常这意味着您在重定向之前将数据输出到您的页面。在输出任何数据之前,您应该始终重定向。输出数据是指在网页上使用 PHP 代码显示任何内容的任何内容,包括 var_dump()echo

标签: php deployment web-applications


【解决方案1】:

顺便说一句,这里是登录代码:

public function logIn($user,$pass){
    $vrfy = $this->conDB();
    $qry = "select * from users";
    $res = $vrfy->query($qry);
    //echo 'alert("Invalid Username or Passwordasd");';
    if($res)
            while($row=$res->fetch_assoc()){
                if($row['username']==$user && $row['password']==$pass)
                if($user=='admin'){
                        $_SESSION['user']=$user;
                        header('location:resource/addash.php');
                                  }
                        
                    else if($user=='associate'){
                        $_SESSION['user']=$user;
                        header('location:resource/asdash.php');
                                               }
            }
        
     echo 'alert("Invalid Username or Password");';
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-11-07
    • 2013-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-21
    • 1970-01-01
    相关资源
    最近更新 更多