PHP passing counterfeit cookie information passed through the curl POST

Some forum sites require daily attendance too much trouble, then I wrote a regular tasks Win by curl to deal with counterfeiting and Cookie header passed;

There is nothing wrong, I hope a lot of corrections bigwigs, thank you big brother:

$fp = @fopen("test.txt", "a+");
$error = @fopen("error.txt", "a+");
date_default_timezone_set("PRC");
$data = date("Y-m-d H:i:s",time());
$result = data();
if ($result['info'] == '操作成功') {
  fwrite($fp , $data. " ping成功!\r\n");fclose($fp);
}else{
  fwrite($error , $data. " ping失败!\r\n");fclose($error);
}

Data function ($ URL) {
  header ( "the Content-type: text / HTML; the Charset = UTF8");
  $ curl_init CH = ();
  curl_setopt ($ CH, CURLOPT_URL to, 'HTTPS: //www.proginn.com/api / Remote / of ping ');
  $ header = Array ();
  curl_setopt ($ CH, CURLOPT_HEADER, to true);
  // will be returned as a string Transfer
  curl_setopt ($ CH, CURLOPT_RETURNTRANSFER,. 1);
  // Close SSL authentication
  curl_setopt ($ CH, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt ($ CH, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt ($ CH, CURLOPT_HTTPHEADER, $ header);
  curl_setopt ($ CH, CURLOPT_COOKIE, '###### go past transmitted through the browser information ##### ');
  $ the curl_exec Content = ($ CH);
  curl_close ($ CH);
  // process the data returned by the regular data processing json return
  preg_match ( "/{.+}/", $ content, $ result);
  return json_decode($result[0],1);
}

Guess you like

Origin www.cnblogs.com/PLasir/p/11387184.html
Recommended