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);
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php