we're trying to post to http://tms.tensingsks.com/tms/config/alh/Scherm2/index.html
it asks for to postal codes and gives you a route from start to destination. shouldn't be a problem except it doesn't work. this is the code we use:
$ch=curl_init();
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;
we built the postfields from a frame capture we did when posting to the site manually (from a browser). the capture shows this:
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
is there something we forgot but need to set? is there a check on the server that sees when the post is not from a browser? does it redirect / relocate and how do we tell curl to follow that link?
any help greatly appreciated!