Answer the question
In order to leave comments, you need to log in
How to submit form data in Google Sheets?
There is a form whose name attribute is petuh
<form action="post.php" method="post">
<textarea class="input" name="petuh" placeholder="Как зовут Вашего петуха?" required/></textarea>
<input id="submit" class="submit" type="submit" name="submit" value="Отправить">
</form>
<?php
$petuh = $_POST['petuh'];
if( $curl = curl_init() ){
curl_setopt($curl,CURLOPT_URL,'https://docs.google.com/forms/d/XXXXYYYY/formResponse');
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_HEADER,true);
if( $html = curl_exec($curl) ){
curl_setopt($curl,CURLOPT_URL,'docs.google.com/forms/d/XXXXYYYY/formResponse');
curl_setopt($curl,CURLOPT_POST,TRUE);
curl_setopt($curl,CURLOPT_POSTFIELDS,"entry.XXXXXXX=$petuh&");
$out = curl_exec($curl);
echo "отправлено";
}
curl_close($curl);
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question