PHPCURL simulates login related questions. You are welcome to watch it out, even if it won't be answered, it will certainly be rewarded.

Source: Internet
Author: User
PHPCURL simulates logon questions for help. You are welcome to watch it out. even if you don't answer it, you will surely get $ post_fields ['Zookeeper '] = $ this-& gt; username; $ post_fields ['mm'] = $ this-& gt; password; $ ch & nbsp; = & nbsp; curl_init ($ this-& php curl simulate logon for help, you are welcome to watch it out, even if you don't answer it, you will surely get it.
$post_fields['zjh']=$this->username;
$post_fields['mm']=$this->password;

$ch = curl_init($this->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, $this->cookie_file);
$str=curl_exec($ch);
curl_close($ch);


This is a code snippet in the class. it is used to simulate logon, but if a problem is found, if the submitted password starts with @, then the CURLOPT_POSTFIELDS section considers that a file has been submitted, this causes logon failure. How can this problem be solved?
CURL description in http://cn2.php.net/curl_setopt

If you don't answer the question, it doesn't matter. do you think it's an inspiration? To prevent your website from being crawled by CURL login, you can find a required form item starting with @, so that my simulated login will become invalid...

Who will answer the question .. Thank you.
------ Solution --------------------
This post was last edited by xuzuning at 09:26:17.
Php-curl encapsulation [avoid file Upload ambiguity Bug]
------ Solution --------------------
Use the httpclient. class. php class to try.

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.