Re: CURL de-bugging: So why am I not getting the results page on the target site?

From: Date: Mon, 07 Jul 2008 22:05:48 +0000
Subject: Re: CURL de-bugging: So why am I not getting the results page on the target site?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-276419@lists.php.net to get a copy of this message
My code is as below. It comes back with 'Bad session variable name - CompanySerialNo' from the site.but the COOKIEJAR does not show this variable name and it is not sent, it just shows:
www.targetsite.com    FALSE    /    FALSE    0    ASPSESSIONIDQCSQDTAB    LKAONANAFJPNMFFECLFNCLBP
There is a serialno but that is sent in the (URL below). Question is: What to test now? I am trying to get a results page from an input page. What code below is trying to do is access the page, get any cookies set then try the page again with the relevant inputs. <? $url="https://www.targetsite.com/subdir/page.asp?serialno=GM201&OtherCode=&NextCode="; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookies.txt"); curl_setopt ($ch, CURLOPT_COOKIEFILE, "cookies.txt"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_URL, $url); /* //GET list from submitting POST form as GET https://www.shortstay-london.com/checkavail.asp? 1 - clock=+09%3A54 2 - &StartDay=6 3 - &StartMonth=September+%3A+2008 4 - &EndDay=13 5 - &EndMonth=September+%3A+2008 ....13 - &CheckThis=Check+This use this list to create POST data */ curl_setopt($ch, CURLOPT_POST, 1); $curlPost=array(); $curlPost["clock"]=" 09:54"; $curlPost["StartDay"]="6"; $curlPost["StartMonth"]="September : 2008"; $curlPost["EndDay"]="13"; $curlPost["EndMonth"]="September : 2008"; //etc $curlPost["CheckThis"]="Check This"; curl_setopt($ch, CURLOPT_POSTFIELDS,$curlPost); curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $store = curl_exec ($ch); curl_close ($ch); print($store); ?>

« previous php.general (#276419) next »