Solved

Ignorant about CGI

Posted on 2002-05-23
12
209 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

11 Experts available now in Live!

Get 1:1 Help Now