I am making the PHP script that will automatically fill Google Forms document. I am doing with Curl.However, there problems with correctness of work this script
$text="forTestOnly";
if( $curl = curl_init() ){
curl_setopt($curl,CURLOPT_URL,'https://docs.google.com/forms/d/1bJXxSXzIkm7NtDCZXE4J3VF5UugVm4B_qTFuGFp1bKE/viewform');
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($curl, CURLOPT_COOKIEFILE, "cookiefile");
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_ENCODING,'gzip,deflate');
curl_setopt($curl,CURLOPT_USERAGENT,'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($curl,CURLOPT_HEADER,true);
if( $html = curl_exec($curl) ){
curl_setopt($curl,CURLOPT_URL,'https://docs.google.com/forms/d/1bJXxSXzIkm7NtDCZXE4J3VF5UugVm4B_qTFuGFp1bKE/viewform');
curl_setopt($curl,CURLOPT_POST,TRUE);
curl_setopt($curl,CURLOPT_POSTFIELDS,"entry.867207060=$text&submit=ok");
$out = curl_exec($curl);
echo $out;
}
curl_close($curl);
}
It gives such error:"HTTP/1.1 405 Method Not Allowed". What is the problem?
With regards
EDIT:
Problem was not in the settings of Curl(POST) but the URL I provided was incorrect.