Php Curl method simulates Telnet

Source: Internet
Author: User
Using the Curl method to simulate Telnet * Analog login bbs.php100.com

$cookie _file= Tempnam ('./temp ', ' Cookie '); $login _url= ' http://bbs.php100.com/login.php '; $post _fields= ' cktime= 31536000&step=2&pwuser= Enter your username here &pwpwd= enter your password here '; $ch = Curl_init ($login _url); curl_setopt ($ch, Curlopt_header, 0); curl_setopt ($ch, Curlopt_returntransfer, 1); Curl_ Setopt ($ch, Curlopt_post, 1); curl_setopt ($ch, Curlopt_postfields, $post _fields); curl_setopt ($ch, Curlopt_cookiejar, $cookie _file); curl_exec ($ch); Curl_close ($ch)  ; $url = ' http://bbs.php100.com/userpay.php '; $ch = Curl_init ($url); curl_setopt ($ch, Curlopt_header, 0); curl_setopt ($ch , Curlopt_returntransfer, 1); curl_setopt ($ch, Curlopt_cookiefile, $cookie _file); $contents = curl_exec ($ch);p Reg_ Match ("/
  • Gold coins: (. *) <\/li>/", $contents, $arr); Echo$arr[1];curl_close ($ch);
  • 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.