I've got this cURL script that works on my host but not on my localhost.
$postData = 'user='.$user.'&paswoord='.$pass;
$getTable= curl_init();
curl_setopt($getTable, CURLOPT_URL, $infoweblink);
curl_setopt($getTable, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($getTable, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($getTable, CURLOPT_ENCODING, 'gzip');
curl_setopt($getTable, CURLOPT_HEADER, false);
curl_setopt($getTable, CURLOPT_RETURNTRANSFER, true);
curl_setopt($getTable, CURLOPT_POST, true);
curl_setopt($getTable, CURLOPT_POSTFIELDS, $postData);
$tableData = curl_exec($getTable);
curl_close($getTable);
Thats all! Just 2 get variables in the post data. And I receive this error:
Request Entity Too Large
The requested resource (site)
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.
I hope that someone can help me. Also I am not sure about if this is the correct site for this question. And is it possible that the server prevents me (my IP) from sending post data?
Edit: withouth the postfields and the post option, it does get the site. So the probplem probalby has t do something with the post option.