Solved

Ignorant about CGI

Posted on 2002-05-23
12
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans

728 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