-
- $data = array( 'Title' => $title, 'Content' => $content, 'ComeFrom' => $comefrom );
- curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE , false);
- curl_setopt($ch, CURLOPT_URL, 'http://example.com/b.php');
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_exec($ch);
-
Copy code
Send the data to be submitted in the form of an array through POST, and this will cause CURL to use the "wrong" encoding "multipart/form-data", which The effect is equivalent to directly completing the operation with a form like "
|