Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit PDF Form into database 1

Status
Not open for further replies.

sgdragon78

Programmer
Oct 14, 2003
17
0
0
SG
Hi All
As PDF form allows user to enter data online. Does anyone knows how to insert the data(from the pdf) into a database?
My initial logic is,
- the pdf will submit form to a url, - the accept.cfm will read in a file from the pdf.
- accept.cfm will insert into database~
Correct logic?

I'm doing a little test here. This is the file submited by PDF:
txtaddress=thsis+address&txtName=this+is+name&cmdSubmit=
 
Your logic is correct.
I had thought that PDF forms did a HTTP_POST... but in looking at your little test, it looks like it's doing a GET.

Either can be handled by accept.cfm... just in the former the variables are in the #FORM# scope, and the latter they're in the #URL# scope.

For your test, code your accept.cfm something like:
Code:
<html>
<head>
   <title>Test</title>
</head>
<body>

<h2>FORM scope:</h2>
<CFDUMP var=&quot;#FORM#&quot;>

<p>&nbsp;</p>

<h2>URLscope:</h2>
<CFDUMP var=&quot;#URL#&quot;>

</body>
</html>

and you'll have a pretty good idea of which scope has the variables by seeing which CFDUMP actually displays data.

Then it's simply a matter of pulling the data from the right scope:
Code:
<CFOUTPUT>#FORM.txtName#</CFOUTPUT>
   or
<CFOUTPUT>#URL.txtName#</CFOUTPUT>
will give you the value that the user entered in the txtName field on the PDF form... depending on which scope you need to use (as determined above).



-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top