php - Google Docs Form Formkey in 2013 Custom Google Form -
php - Google Docs Form Formkey in 2013 Custom Google Form -
hello i'm trying develop curl php send google form through php first , redirect landing page. issue lies within old google formkey response.
before view form source , have formkey id number insert php script.
here script sample:
//google form key $formkey = "where formkey"; $thankyou = "http://www.eksenaevents.com/submission-successful/"; //change url google form address $googleformurl = "https://docs.google.com/forms/d/1pcihfvau8kur_j1gsax2wegcdrgjnh0merdeinbwd- 0/viewform"; //----------------send form fields google-------------------- //loops through form fields , creates query string submit google foreach ($_post $var => $value) { if ($var != "ignore") { $postdata=$postdata . htmlentities(str_replace("_", "." , $var)) . "=" . $value . "&"; } } //remove comma $postdata=substr($postdata,0,-1); //submit form fields google $ch = curl_init(); curl_setopt ($ch, curlopt_url,$googleformurl); curl_setopt ($ch, curlopt_ssl_verifypeer, false); curl_setopt ($ch, curlopt_useragent, "mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.6) gecko/20070725 firefox/2.0.0.6"); curl_setopt ($ch, curlopt_timeout, 60); curl_setopt ($ch, curlopt_followlocation, 1); curl_setopt ($ch, curlopt_returntransfer, 1); curl_setopt ($ch, curlopt_postfields, $postdata); curl_setopt ($ch, curlopt_post, 1); $data = curl_exec ($ch); curl_close($ch); //echo $data; //redirect give thanks page header( "location: $thankyou" ) ; ?>
i know guy won't see other people, form key is. . 1pcihfvau8kur_j1gsax2wegcdrgjnh0merdeinbwd
also google form url should this
https://docs.google.com/yourdomainwhatev/spreadsheet/formresponse?formkey=insert form key here#gid=0
if open form, re-create web address , rip out form key
php web
Comments
Post a Comment