Curl function
function Search ($url, $curlPost) {
$cookiejar = Realpath (' cookie.txt ');
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_header, 0);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_post, 1);
curl_setopt ($ch, Curlopt_postfields, $curlPost);
curl_setopt ($ch, Curlopt_cookiejar, $cookiejar); To callback a cookie
$data =curl_exec ($ch);
Curl_close ($ch);
return $data;
}
?>
I want to use PHP to realize the external network machine through my Computer access to the intranet resources, one is my network login intranet Web site data interaction, and the other is through my php file with the Curl function when accessed, it hints about what files are missing. Does anyone know how to fix it? Curl PHP
Share to:
------Solution--------------------
The mechanism of the IFRAME is
1. The browser gets the page that carries the IFRAME element
2. Browser Rendering page
3. Browser detects IFRAME elements
4. The browser re-requests the contents of the page contained in the IFRAME
5. Render the page that the IFRAME contains
Yes, you're here.
1. Browser initiated request Login!checklogin.action
2. Render Page
3. An IFRAME element is detected (for example, an IFRAME containing header.html)
4, Browser re-request header.html
5. Render header.html Page
Now, here's your case.
1, the browser on your host request, your host request intranet Login!checklogin.action
2. Browser Rendering page
3. The IFRAME element is detected
4. browser to you request header.html, where did you come to header.html?
So the solution is
1, the browser on your host request, your host request intranet login!checklogin.action, while modifying the IFRAME in the SRC from the original header.html changed to proxy. php?page=headerl.html
2. Browse Render Page
3. IFRAME Detected
4. Initiate a request agent for your host. php?page=header.html, Agent. PHP to get HTML content back in the intranet
5, render the actual content of header.html page