Php retrieves the entire page instance. first use $ _ SVERVER to obtain the address before the jump page. use the crul function to obtain the entire page.
Php gets the entire page instance. first use $ _ SVERVER to get the address before the jump to the page. use the crul function to get the whole page:
The code is as follows:
PHP code
-
- $ Cookie_jar = tempnam ('./tmp', 'cooker ');
- // Initialize curl
- $ Ch = curl_init () or die (curl_error ());
- $ Title = $ _ POST [title];
- Print_r ($ title );
- // Set URL parameters
- Curl_setopt ($ ch, CURLOPT_URL, "$ _ SERVER [HTTP_REFERER]");
- Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ title );
- // Save the returned cookie information in the $ cookie_jar file.
- Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ cookie_jar );
- Print_r ($ _ cookie );
- // Request that CURL return data
- Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
- // Execute the request
- $ Result = curl_exec ($ ch) or die (curl_error ());
- // Obtain the returned result and display it
- Echo $ result;
- Echo curl_error ($ ch );
- // Disable CURL
- Curl_close ($ ch );
- ?>