|
Posted by devranger on 12/25/06 19:38
I have been reading up on what you suggested Rik and testing different
options but I am still not successful in getting the results returned.
I have set the curl_setopt($ch, CURLOPT_REFERER, $url); and also set up
to curl sessions, one to capture the cookie and the other to post with
the cookie (see below): I really feel it may have something to do
with the long input names and : in the input name of my $data variable,
but Jerry said the data vaiable was correct.
Does anyone have any other suggestion on how I could get this working?
Your help is much appreciated, I feel I have learned so much so far.
Thank you!!!!
$data="MasterTemplate:_PageTemplate:cphCenterContent:CenterContent:fcDropDownList=ATVs&MasterTemplate:_PageTemplate:cphCenterContent:CenterContent:zipTextBox=77090";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURL_ERROR, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
$result = curl_exec ($ch);
curl_close ($ch);
// create a new curl resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURL_ERROR, 1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 600);
curl_setopt($ch, CURLOPT_TIMEOUT, 600);
// grab URL, and return output
$Contents = curl_exec($ch);
Navigation:
[Reply to this message]
|