V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xiaoyu9527
V2EX  ›  PHP

求 PHP 大牛看看这个插件有什么报错

  •  
  •   xiaoyu9527 · 2017-07-04 12:41:01 +08:00 · 1735 次点击
    这是一个创建于 2488 天前的主题,其中的信息可能已经有所发展或是发生改变。

    服务器环境 WIN2012R2 IIS8.5 PHP5.2

    代码

    '".$pasttime."' "; $res=$query->execute($sql); $rowsnum = $query->db->getRowsNum($res); //总结果数 $row=''; $fp = fopen("pingbaidu.log",'ab'); //以二进制追加方式打开文件,没文件就创建 while($row=$query->getRow()){ $urls[] = "http://www.xxx.com/book/".$row['articleid'].".html"; //输出数据(这里是你的网站网址格式,按你自己的格式来修改) } $api = 'http://data.zz.baidu.com/urls?site=www.xxx.com&token=6yKwKWId8j9gJ4o6';(这里是百度推送接口地址,修改成你自己的) $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode("\n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); $result= $result."\n"; fwrite($fp, $result, strlen($result)); fclose($fp); //关闭文件 flush(); ?>

    报错

    Parse error: syntax error, unexpected T_VARIABLE in D:\wwwroot\www.xxx.com\tui.php on line 30

    xiaoyu9527
        1
    xiaoyu9527  
    OP
       2017-07-04 12:42:06 +08:00
    奇怪 怎么粘的这么丑陋。

    没有代码格式的代码么?
    nfroot
        2
    nfroot  
       2017-07-04 14:01:07 +08:00
    左下角有预览按钮,右边侧栏有帮助。
    xiaoyu9527
        3
    xiaoyu9527  
    OP
       2017-07-04 15:35:04 +08:00
    已经解决了。

    沉了吧。
    swcat
        4
    swcat  
       2017-07-04 21:06:59 +08:00 via iPhone
    终于知道 php 为什么老是被人黑了😂
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2252 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:44 · PVG 08:44 · LAX 17:44 · JFK 20:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.