Using CURL spoofing in PHP to crawl pages or files. The copy code is as follows: initialize $ curlcurl_init (); the URL to be accessed: curl_setopt ($ curl, CURLOPT_URL, asen. me); set the current URL: curl_setopt ($ curl, CURLOPT_RE
The code is as follows:
// Initialization
$ Curl = curl_init ();
// URL to be accessed
Curl_setopt ($ curl, CURLOPT_URL, 'http: // asen. me /');
// Set the Origin path
Curl_setopt ($ curl, CURLOPT_REFERER, 'http: // google.com /');
// Do not enter the content directly
Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1 );
// Save the Drop result to $ result.
$ Result = curl_exec ($ curl );
// Close
Curl_close ($ curl );
Note: To use this method, make sure that your PHP environment supports and the CURL module is enabled.
The http://www.bkjia.com/PHPjc/323396.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/323396.htmlTechArticle code is as follows: // initialize $ curl = curl_init (); // the URL to access curl_setopt ($ curl, CURLOPT_URL, 'http: // asen. me/'); // you can set curl_setopt ($ curl, CURLOPT_RE...