Problems with POST and cookies

Zippo007

New Member
I have a PHP script with cURL that does a POST request to an ASP file (not mine, so I can't change it).I have set a Cookie (\[code\]ASPSESSIONID\[/code\]) that I have received from Echo (an HTTP POST app for Mac) and used it in my code, but when I change my POST variables it still returns the same data as before, but when I make the POST using Echo (with the same Cookie) it works, and receives new data. When I now make the same request with my script it works also! How can I do this without Echo?My code:\[code\]$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS, "Bgnm=3Ve&rst=$rst"); curl_setopt($ch, CURLOPT_HTTPHEADER,array('Cookie: ASPSESSIONIDAACQRCDD=LAODBMKAPLDAJNILIKFGFPFP'));$output = curl_exec($ch);$info = curl_getinfo($ch);curl_close($ch);\[/code\]The normal HTML Form (fully working):\[code\]<form method="post" target="rechts"> <p align="center"> <br>Kies een basisgroep:<br><select name="Bgnm"><option>1a</option><option>1b</option></select><br><br>Kies een roostersoort:<br><select name="rst"><option selected="">Basisrooster</option><option>Rooster deze week</option><option>Rooster volgende week</option> </select><br><br>en druk op deze knop:<br><input type="submit" value="http://stackoverflow.com/questions/14414351/toon lessen en lijst"></p></form>\[/code\]My setup in Echo:Echo setup (image)
 
Back
Top