• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Ignorant about CGI

Hello experts,

I'm trying to save the contents of an Acrobat form to a database. The Acrobat help files says this:

"For this process to work, you must have a CGI application on the Web server to collect and route the data to a database. Any existing CGI application that collects data from forms (in HTML or FDF format) can be used to collect data from PDF forms."

I'm not familiar with Perl. All I know about it is that CGI is done in Perl most of the time (if that is even correct).

Anyway, I'm familiar with ASP (using VBScript, sometimes JavaScript). Is the collection of data that Acrobat is talking about similar to Reqeust.Form("Field_Name") in VBScript? If so, I guess I can do it in ASP instead of Perl. Is that right? If not, please someone show me how to do this in Perl.

Layman's terms please -- I'm Perl ignorant, remember.
0
dbnewbie
Asked:
dbnewbie
  • 5
  • 5
  • 2
1 Solution
 
lexxwernCommented:
even tho im a asp layman im sure you can do it with asp; but with perl it is definitely possible this is what you must do...

(1) Get information from the form, how to do it depends on your method GET or POST
(2) Insert values into table, Its pretty easy with the DBi module
(3) Thats All!
0
 
dbnewbieAuthor Commented:
got code?
0
 
dbnewbieAuthor Commented:
got code?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
lexxwernCommented:
show the form code, then ill be able to write...
0
 
dbnewbieAuthor Commented:
oh, let's do something really simple. say the document only has one text box in the form. we'll name that field "FName."

since adobe is seemingly saying that what works for HTML should work acrobat. i already tried redirecting the acrobat form to an ASP application that does a Request.Form("FName") -- no go.

also, what do i do w the code once u post it here? is it just a matter of putting it in any directory and making sure the form action points to it?
0
 
GorGor1Commented:
this is CGI basics, I'll let someone else get into the database thing.  I don't have my database code here with me:

----------------------------------
<html>
<body>
<form action="http://yourSite.com/yourPerlScript.cgi" method="post">
<input type="text" name="FName" value="" size=20>
<input type="submit" value="   Submit   ">
</form>
</body>
</html>
-----------------------------------

in your Perl(CGI) script:

---------------------------------------

#!c:/perl -w   #(-w = show warnings)
use strict;    #(use strict to help debug later)

use CGI;       #(load cgi module)

my $fname = param('FName');  #the variable is expected from the form

#Now you can do whatever you want with $fname
#Let's print it to a web page

print "Content-type: text/html\n";

print qq{
<html>
<body>
<center>
<font color="red">
You have just submitted a form and the value you submitted was $fname<br>
<br>
</font>
</center>
</body>
</html>
};

exit;

--------------------------------------
0
 
GorGor1Commented:
I don't know enough about PDF forms to be able to give you any useful information.  But above is how you handle html forms.
0
 
dbnewbieAuthor Commented:
how do i set this up to work? i'm using windows XP professional.
0
 
GorGor1Commented:
Are you going to be doing this on the web for web users?  Do you have a web server installed?  Do you have Perl installed?
0
 
GorGor1Commented:
also, do you have MS Access installed for your database application?
0
 
dbnewbieAuthor Commented:
yes, on the web for web users. i have IIS installed, which comes w windows XP. i do not have Perl installed. how do i go about doing that? I have MS Access XP for my database application.

ur Perl code looks very similar to my ASP code. i hope Perl works better than ASP.
0
 
GorGor1Commented:
go to www.activestate.com and download and install activePerl.  It's fairly straight forward.  I'll give you time to get it installed and I'll be back later with more help and some code to help you out.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 5
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now