Originally, I asked this question in the html forums, and they directed me to use cURL. Now, after spending the last day and a half looking it over, im stuck.
Here is my current code:
Whenever I run this, I do not get any of the information I am expecting. I am directed to a page (click here to see) that tells me my entry is expired. Here is what the header returns to me:
In looking at that, it appears the cookies (mageid,path,sessionid, etc.) contain NO data, correct?
So basically, I have concluded at this point the reason my code isnt working is because I have not sent over the cookie information to tell the server it is me trying to retreive this data. Correct me if I am wrong.
So, the purpose of this post is this:
How do I first obtain, then send this data to the server in order to acquire the info I am so desperately trying to receive?
Here is my current code:
Code:
<?php
$HTTP_method = 'http';
$hostname = 'app.the-reincarnation.com';
$cgi = '/cgi-bin/rank.cgi?guild=15';
$curl_handle = curl_init ();
curl_setopt ($curl_handle, CURLOPT_URL, $HTTP_method . '://' . $hostname . $cgi);
curl_setopt ($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_HEADER, 1);
curl_setopt($curl_handle, CURLOPT_REFERER,"[URL unfurl="true"]http://app.the-reincarnation.com/cgi-bin/guilddetails.cgi?guild=12");[/URL]
//curl_setopt($curl_handle, CURLOPT_COOKIEFILE,"cookiefile");
//curl_setopt($curl_handle, CURLOPT_COOKIEJAR,"cookiefile");
$result = curl_exec ($curl_handle) or die ('There has been an error');
curl_close ($curl_handle);
print $result;
?>
Whenever I run this, I do not get any of the information I am expecting. I am directed to a page (click here to see) that tells me my entry is expired. Here is what the header returns to me:
Code:
HTTP/1.1 200 OK Date: Thu, 19 Jan 2006 10:07:42 GMT Server: Apache/1.3.34 (Unix) mod_perl/1.29 Pragma: no-cache Cache-Control: private Set-Cookie: uid=; path=/; expires=Tue, 20-Dec-2005 10:07:42 GMT Set-Cookie: mage=; path=/; expires=Tue, 20-Dec-2005 10:07:42 GMT Set-Cookie: mageid=; path=/; expires=Tue, 20-Dec-2005 10:07:42 GMT Set-Cookie: sessionid=; path=/; expires=Tue, 20-Dec-2005 10:07:42 GMT Connection: close Transfer-Encoding: chunked Content-Type: text/html
So basically, I have concluded at this point the reason my code isnt working is because I have not sent over the cookie information to tell the server it is me trying to retreive this data. Correct me if I am wrong.
So, the purpose of this post is this:
How do I first obtain, then send this data to the server in order to acquire the info I am so desperately trying to receive?