全球主机交流论坛

标题: 自己写了个php处理监控宝URL回调的页面,为什么不行? [打印本页]

作者: SalesHosting    时间: 2012-2-9 11:51
标题: 自己写了个php处理监控宝URL回调的页面,为什么不行?
本帖最后由 SalesHosting 于 2012-2-9 11:57 编辑

我的帖子已经被李院长秒杀了。。。

为什么一执行就500错误?我php没怎么学过,见笑了。
  1. <?php
  2. $msg_id      = $_GET['msg_id'];
  3. $task_id     = $_GET['task_id'];
  4. $fault_time  = $_GET['fault_time'];
  5. $token       = $_GET['token'];
  6. $url_token   = '';
  7. $task_status = $_GET['task_status'];

  8. $normal_time = date('r', $fault_time);
  9. //如果校验成功,则说明此消息为监控宝系统发出,否则为非法请求,不予处理
  10. if (md5($msg_id . $task_id . $fault_time . $url_token) == $token) {
  11.    
  12.   if ($task_status == 1) {
  13.     echo "Time:";
  14.     echo $normal_time;
  15.     echo "<br><h1>The server is <b>DOWN</b>!</h1>";
  16.   }
  17.   
  18.   else if ($task_status == 0) {
  19.     echo "Time:";
  20.     echo $normal_time;
  21.     echo "<h1>The server is <b>FINE</b>!"
  22.   }
  23.   
  24. }
  25. ?>
复制代码

作者: hitsword    时间: 2012-2-9 11:53
啥玩意?
作者: 李院长    时间: 2012-2-9 11:54
22行少了;结尾
作者: SalesHosting    时间: 2012-2-9 11:54
hitsword 发表于 2012-2-9 11:53
啥玩意?

监控宝,没用过?jiankongbao.com
作者: 用户名    时间: 2012-2-9 11:54
自己找出错误的地方~
作者: SalesHosting    时间: 2012-2-9 11:55
李院长 发表于 2012-2-9 11:54
22行少了;结尾

...李院长。。。

好吧,我没看见。。。




欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/) Powered by Discuz! X3.4