dongyuchen0214 2017-05-16 00:19
浏览 37

PHP全局变量似乎在开发服务器上导致HTTP 500错误,但不是活动服务器

I am in the process of migrating a website that was developed in India, and moving it to another webhost. Not being an expert at PHP has my head hurting from tracing the code. I think I narrowed down the problem to this bit here...

<?php include("../config.php"); ?> 
<?php include("../header.php"); 
    if(!empty($_REQUEST)){
        $newsid = $_REQUEST['name'];
?>
<script>
$(document).ready(function() {
    $('.story_container').each(function(index) {
        if ($(this).attr("id") == '<?php print $newsid; ?>' ) {
            $(this).show();
        }
        else {
            $(this).hide();
        }
    });
});
</script>


<?
}

?> 

Specifically, if I delete the third and fourth lines, the 500 error goes away and the page loads, although not correctly, with a $newsid item loaded in the main part of the webpage.

If I'm not mistaken, there is a formatting error and looks like it is missing a terminating curly brace? The purpose of the opening and closing php tag at the end just to include a curly brace has me perplexed. If I close the if statement, the 500 error goes away, but again, the page doesn't load with a $newsid item in the main part of the webpage.

I am at a loss and hoping someone can help me troubleshoot this. Thanks!

Almost forgot. I mentioned the site was developed in India because this page in particular I had converted from ANSI format to UTF-8, in case that gives any more clues.

  • 写回答

1条回答 默认 最新

  • dsf5632 2017-05-16 05:39
    关注

    Thank you Rasclatt, the issue was that short codes were not enabled.

    评论

报告相同问题?

悬赏问题

  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”