zoukankan      html  css  js  c++  java
  • Ping百度自动提交网址

    <?php
        function postUrl($url,$postvar){
            $ch = curl_init();
            $headers = array(
                    "POST".$url."HTTP/1.0",
                    "Content-type: text/xml;charset="utf-8"",
                    "Accept: text/xml",
                    "Content-length:".strlen($postvar)
                );
            curl_setopt($ch,CURLOPT_URL,$url);
            curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
            curl_setopt($ch,CURLOPT_POST,1);
            curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
            curl_setopt($ch,CURLOPT_POSTFIELDS,$postvar);
            $res = curl_exec($ch);
            curl_close($ch);
            return $res;
        }
        $baiduXML = "<?xml varsion="1.0"> encoding="utf-8"?>
                    <methodCall>
                        <methodName>weblogUpdates.extendedPing</methodName>
                        <params>
                            <params><value>新浪新闻</value></params>
                            <params><value><string>http://wwww.wwww.com/index.php</string></value></params>
                            <params><value><string>http://wwww.wwww.com/index.php/html_1.html</string></value></params>
                            <params><value><string>http://wwww.wwww.com/index.php/html_2.html</string></value></params>
                            <params><value><string>http://wwww.wwww.com/index.php/html_3.html</string></value></params>
                        </params>
                    </methodCall>
        ";
        $res = postUrl('http://ping.baidu.com/ping/RPC2',$baiduXML);
    
        var_dump($res);
  • 相关阅读:
    批量管理增量日志(seek、tell)
    字符串和编码
    5.activiti--完成任务
    4.activiti--代理任务Claiming the task
    3.activiti--待办任务
    2.activiti-启动流程实例
    1.activiti-流程图
    html 各种高度
    redis-过期时间、访问限制与缓存
    spring mvc controller 接收参数
  • 原文地址:https://www.cnblogs.com/shanyansheng/p/5488358.html
Copyright © 2011-2022 走看看