i have a problem posting to certain sites using perl. what i try to do is this:
curl_setopt($ch, CURLOPT_REFERER, "http://tms.tensingsks.com/tms/config/alh/Scherm2/index.html");
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_PROXY, "proxy.intra.syntegra.nl:8080");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$res=curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, "http://tms.tensingsks.com/tms/scripts/tgigw.dll");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "app=resolve&cmd=resolve2&config=alh&posturl=&redirurl=http%3A%2F%2Ftms.tensingsks.com%2Ftms%2Fscripts%2Ftgigw.dll%3FAPP%3DTMS%26CMD%3DROUTE%26OUTPUT%3DHTML%26&RMODE=FAST&countryid1=0&countryid2=0&seltype1=1&pc1=1112ab&seltype2=1&pc2=1111aa&straat1=&straat2=&plaats1=&plaats2=&poicatid1=-1&poicatid2=-1&poi1=&poi2=&poiplaats1=&poiplaats2=&rmode=fast");
$res=curl_exec($ch);
curl_close($ch);
echo $res;
this is built on the next frame capture of the post to the site itself:
POST http://tms.tensingsks.com/tms/scripts/tgigw.dll HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, /
Referer: http://tms.tensingsks.com/tms/config/alh/Scherm2/index.html
Accept-Language: nl
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
Host: tms.tensingsks.com
Content-Length: 348
Proxy-Connection: Keep-Alive
Pragma: no-cache
app=resolve&cmd=resolve2&config=alh&posturl=&redirurl=http%3A%2F%2Ftms.tensingsks.com%2Ftms%2Fscripts%2Ftgigw.dll%3FAPP%3DTMS%26CMD%3DROUTE%26OUTPUT%3DHTML%26&RMODE=FAST&countryid1=0&countryid2=0&seltype1=1&pc1=1112ab&seltype2=1&pc2=1111aa&straat1=&straat2=&plaats1=&plaats2=&poicatid1=-1&poicatid2=-1&poi1=&poi2=&poiplaats1=&poiplaats2=&rmode=fast
HTTP/1.0 301 Moved Permanently
Server: Tensing-SKS TGI
Content-Type: text/html
The problem is, it doesn't return anything and takes forever while doing it manually works fine. is there something in the packet capture that i need to do with curl options too?
i can curl to other sites perfectly (and i love it! 🙂
please let me know if you can see what's going wrong