Note that there are some explanatory texts on larger screens.

plurals
  1. POForm submission to google form using CURL
    text
    copied!<p>I wrote the following code but then it's submitted Internal error appears. I have no ideas on what is going wrong.</p> <pre><code>&lt;?php //extract data from the post //extract($_GET) ; //set POST variables //The form https://spreadsheets.google.com/viewform?authkey=CJPbtZkI&amp;hl=en&amp;formkey=dEd5UFhRQ1ZfNzcwU1UwOVhIbF92cGc6MQ&amp;ifq $url = 'https://spreadsheets.google.com/formResponse?authkey=CJPbtZkI&amp;amp;hl=en&amp;amp;formkey=dEd5UFhRQ1ZfNzcwU1UwOVhIbF92cGc6MQ&amp;amp;ifq' ; $fields = array( 'pageNumber'=&gt;urlencode("0" ) , 'backupCache'=&gt;urlencode("") , 'submit'=&gt;urlencode("Submit"), 'entry.0.single'=&gt;urlencode("") , 'entry.1.single'=&gt;urlencode("") , 'entry.2.single'=&gt;urlencode("") , 'entry.3.single'=&gt;urlencode("") , 'entry.4.single'=&gt;urlencode("") , 'entry.5.single'=&gt;urlencode("") , 'entry.6.single'=&gt;urlencode("") , 'entry.7.single'=&gt;urlencode("") , 'entry.8.single'=&gt;urlencode("") , 'entry.9.single'=&gt;urlencode("") , 'entry.10.single'=&gt;urlencode("") , 'entry.11.single'=&gt;urlencode(""), 'entry.12.single'=&gt;urlencode("") ); //url-ify the data for the POST foreach($fields as $key=&gt;$value) { $fields_string .= $key.'='.$value.'&amp;' ; } rtrim($fields_string ,'&amp;') ; //open connection $ch = curl_init() ; //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL,$url) ; curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml','Accept-Charset: UTF-8')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string) ; //execute post $result = curl_exec($ch) ; print_r($fields_string); //close connection curl_close($ch) ; ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload