, PHP automatically ping Baidu's then.

Source: Internet
Author: User
For help, PHP automatically ping Baidu's then ....
Little brother has a PHP station, the program did not automatically ping Baidu rss function, but I want to add one, so from the Internet to find the paragraph code as follows:
PHP Code
  
     
  
    
     
    
     weblogupdates.extendedping 
      
     
      
   
  
      $url 
     
     
      
   
  
      $url   
  
     
  
     
 
        
    
    

   
  "; $res = PostURL (' http://ping.baidu.com/ping/rpc2′, $baiduXML);? >

And then.... No, then ...
Want to ask you how big, how can finally realize this RSS auto ping Baidu? For detailed steps, the younger brother is PHP rookie!

------Solution--------------------
PHP Code
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;} $url = "; Don't know what this value is $baiduxml = "
     
  
    
     
    
     weblogupdates.extendedping 
      
     
      
   
  
      $url 
     
     
      
   
  
      $url   
  
     
  
     
 
        
    
    

   
  "Echo $res = PostURL (' http://ping.baidu.com/ping/RPC2 ', $baiduXML);
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.