Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I submit an HTML form to Google docs as well as to a PHP file
    text
    copied!<p>I have the following form : </p> <pre><code>&lt;div class="ss-form"&gt; &lt;form onsubmit = "return validateForm();" action="https://spreadsheets.google.com/formResponse?hl=en&amp;amp;formkey=dHXVVeEUybk9UNEVYdEdrNlVOSTZMbFE6MA&amp;amp; theme=0AX42CRXMsmRFxMDNhN2Y&amp;amp;ifq'" method="POST" id="ss-form" name="data"\&gt; </code></pre> <p>This works well, and submits the data to Google Docs. </p> <p><strong>My question is, how can I submit this form to google docs AND submit it to a PHP file at the same time?</strong></p> <p>I have tried using php include, but it does not work as the google docs link is not a php file.</p> <p>Also tries using cURL but not sure what Im doing wrong : </p> <pre><code> //set options $curl_connection = curl_init('https://spreadsheets.google.com/'); curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1); //set data to be posted $post_string = "formResponse?hl=en&amp;amp;formkey=dHXVVeEUybk9UNEVYdEdrNlVOSTZMbFE6MA&amp;amp; theme=0AX42CRXMsmRFxMDNhN2Y&amp;amp;ifq"; curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string); $result = curl_exec($curl_connection); //show information regarding the request print_r(curl_getinfo($curl_connection)); echo curl_errno($curl_connection) . '-' . curl_error($curl_connection); //close the connection curl_close($curl_connection); </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