Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using CFHTTP to submit a form directly to a google docs form

New Here ,
Sep 19, 2009 Sep 19, 2009

Ok so here is some background

Google has a service where you can create forms using google docs and embed them into your webpage, Results are automatically stored in a google spreadsheet upon submission.

I want to use my own form to submit to to the google form processing page which I can get to work however the default generic google hosted thank you page appears upon submissing.

I know you can use cfhttp to submit a form from a coldfusion server so I was thinking that I could simply pass my form variables to a action page that resubmitted them via cfhttp and thus bypass the thank you page altogether

however when I try this it does not work and the results do not show up in the google spreadsheet. I figured that mabye the google processing page could tell that it was not submitted from a browser so I tired adding a useragent string but still no luck.

Here is the code I was trying to use

<cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" redirect="yes" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
 
     <cfhttpparam type="Formfield" name="entry.0.single" value="testValue1" >
     <cfhttpparam type="Formfield" name="entry.1.single" value="testValue2" >
     
</cfhttp>

And the online spread sheet can be viewed here


http://spreadsheets.google.com/pub?key=tlo4FjygqMuUGmvuOb2_Gjw&single=true&gid=0&output=html

Does anyone know why this is not working?

To recap I am able to use the following form on my own comptuer to directly submit to the processing page and this works

<form action="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" method="POST">
<input type="text" name="entry.0.single" value="" >
<input type="text" name="entry.1.single" value="">
<input type="submit" name="submit" value="Submit">
</form>

Any help would be greatly appreciated

TOPICS
Advanced techniques
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 19, 2009 Sep 19, 2009
LATEST

This was answered in another section

http://forums.adobe.com/message/2259593

trick was to also include the submit value as a form field

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources