Solved

Ignorant about CGI

Posted on 2002-05-23
12
210 Views
Last Modified: 2010-03-05
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
Comment
Question by:dbnewbie
  • 5
  • 5
  • 2
12 Comments
 
LVL 12

Expert Comment

by:lexxwern
ID: 7030987
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
 

Author Comment

by:dbnewbie
ID: 7030997
got code?
0
 

Author Comment

by:dbnewbie
ID: 7031014
got code?
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7031022
show the form code, then ill be able to write...
0
 

Author Comment

by:dbnewbie
ID: 7031156
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
 
LVL 1

Accepted Solution

by:
GorGor1 earned 50 total points
ID: 7031864
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:GorGor1
ID: 7031867
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
 

Author Comment

by:dbnewbie
ID: 7032373
how do i set this up to work? i'm using windows XP professional.
0
 
LVL 1

Expert Comment

by:GorGor1
ID: 7032408
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
 
LVL 1

Expert Comment

by:GorGor1
ID: 7032427
also, do you have MS Access installed for your database application?
0
 

Author Comment

by:dbnewbie
ID: 7032473
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
 
LVL 1

Expert Comment

by:GorGor1
ID: 7032505
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now