简体   繁体   English

php [处理此指令时发生错误]

[英]Php [an error occurred while processing this directive]

I am having problem with my php code. 我的php代码有问题。 Directory and its code is working fine when direct accessing 直接访问目录及其代码正常

For example subdomain.domain.com/folder_name_c/index.php?id=1 例如subdomain.domain.com/folder_name_c/index.php?id=1

but when I use header() function to redirect to that directory it generates error. 但是当我使用header()函数重定向到该目录时,它将生成错误。 [an error occurred while processing this directive] [在执行此命令时出现的错误]

Here is the code that I am using. 这是我正在使用的代码。

if($_POST){

    if($_POST['xyz'] != '' && $_POST['xyz2'] != ''){
        header("Location http://subdomain.domain.com/folder_name_c/index.php?id=".$_POST['comp']."&xyz=".$_POST['xyz']."&xyz2=".$_POST['xyz2']);
    }else if($_POST['month'] != ''){
        header("Location http://subdomain.domain.com/folder_name_c/index.php?id=".$_POST['comp']."&xyz=".$_POST['xyz']);
    }

}

Help will be appreciate. 帮助将不胜感激。

I think the problem is in 我认为问题出在

header("Location: ...

you need a colon after Location 您需要在位置后加一个冒号

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM