search

Home  >  Q&A  >  body text

curl simulated login

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, $url);//Log in to the submitted address

curl_setopt($curl, CURLOPT_HEADER, 0);/ /Whether to display header information

curl_setopt($curl, CURLOPT_RETURNTRANSFER, 0);//Whether to automatically display the returned information

curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie); //Set Cookie The information is saved in the specified file

curl_setopt($curl, CURLOPT_POST, 1);//Submit in post mode

curl_setopt($curl, CURLOPT_POSTFIELDS, $post);//To be submitted Information

curl_exec($curl);//Execute cURL

curl_close($curl);//Close

$post = "loginname=****** &password=******";

$url = "http://www.jinhu11.com/index/index/login";

$ cookie = dirname(__FILE__) . '/cookie_jinhu.txt';

Why the simulated login is not successful.

phpcn_u68041phpcn_u680412550 days ago1534

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-12-10 12:32:32

    This depends on whether your server has done corresponding anti-packet capture processing. You can check the return information of your submission verification

    reply
    0
  • Cancelreply