hi,
i followed your instruction and wrote the following code. Still it is showing me session expired.in cookie.txt file i am able to get the session id stored. Can you tell me possible reason for this and also the solution for this.
here is the code:
<?php
$post_data = array();
$post_data['firstname'] = "Brijesh";
$post_data['lastname'] = "patel";
$post_data['snumb'] = "adafd";
$post_data['anumb2'] = "adfa";
$post_data['city'] = "bharuch";
$post_data['state'] = "gujarat";
$post_data['zip'] = "43234223";
$post_data['country'] = "USA";
$post_data['phone'] = "4134134143";
$post_data['email'] = "abc@abc.com";
$post_data['userid'] = "";
$post_data['password'] = "";
$post_data['submit'] = "Continue";
$post_data['amount'] = "5";
$post_data['recurring'] = "off";
$post_data['s_recurring'] = "";
$post_data['designategift2'] = "society upliftment";
$post_data['ShareBox'] = "GiveNameEmail";
$post_data['Option'] = "";
$post_data['submit1'] = "Donate Now";
$post_data['onBehalf_Name'] = "";
$post_data['onBehalf_email'] = "";
$post_data['Matching_Company'] = "";
$post_data['Matching_Email'] = "";
$post_data['cardType'] = "Visa";
$post_data['cardNum'] = "232325433453435343";
$post_data['cardExpMo'] = "08";
$post_data['cardExpYr'] = "10";
$url = "http://www.nycharities.org/donate/processtransaction_new.asp";
$o="";
foreach ($post_data as $k=>$v)
{
$o.= "$k=".utf8_encode($v)."&";
}
$post_data=substr($o,0,-1);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.nycharities.org/donate/UserInfo.asp?firstname=BRIJESH&lastname=abc&snumb=234%2Cadfjkd%2Cadfjd&snumb2=adfa&city=Bharuch%2C+Gujarat.&state=Toronto&zip=2323923&country=USA&phone=2342342423&email=abc%40abc.com&userid=&password=&submit=Continue");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'C:\Program Files\EasyPHP1-8\www\personal\cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'C:\Program Files\EasyPHP1-8\www\personal\cookie.txt');
curl_exec($ch);
// stop preventing output
curl_setopt($ch, CURLOPT_POST, 1);
// curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_COOKIEJAR, 'C:\Program Files\EasyPHP1-8\www\personal\cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'C:\Program Files\EasyPHP1-8\www\personal\cookie.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, "https://www.nycharities.org/donate/thankyou.asp");
curl_setopt($ch, CURLOPT_COOKIEFILE, 'C:\Program Files\EasyPHP1-8\www\personal\cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close ($ch);
echo $result;
?>