Solved

How to pass a parameter for a perl script through the "FORM ACTION" of an HTML

Posted on 1997-05-20
2
352 Views
Last Modified: 2013-12-25
Hi ALL,
I want to pass two parameters for a perl script using the path of "ACTION" within an HTML form. If input data is inserted and a perl script without a parameter is run, the data is normally passed. However, if the URL below is used to pass two parameters, these parameters were not passed although the data which was inserted through the fill-out form is printed without any problem.
I would be grateful if anyone could answer this qustion.

-----
 <FORM METHOD="GET" ACTION="http://goldstar/cgi-bin/user7/diff.pl?FILEID=$comp_id&FILENAME=$file_name">
<INPUT NAME="field1"> <P>
<INPUT NAME="field2"> <P>
To submit the query, press this button: <INPUT TYPE="submit"
VALUE="Submit Query"> <P>
</FORM>
---------------------------------
When the perl script(diff.pl) was run the URL was as follows:
http://goldstar/cgi-bin/user7/diff.pl?field1=1.4&field2=1.5
-----
0
Comment
Question by:dcs0ock
2 Comments
 

Author Comment

by:dcs0ock
Comment Utility
Edited text of question
0
 
LVL 5

Accepted Solution

by:
icd earned 20 total points
Comment Utility
I think you have mixed up your html and your perl in that example but I see what you are trying to do.

One way to pass extra variables is to use the 'hidden' data type. You would change your 'html' to:-

<FORM METHOD="GET" ACTION="http://goldstar/cgi-bin/user7/diff.pl">
<INPUT NAME="field1"> <P>
<INPUT NAME="field2"> <P>
<INPUT TYPE="HIDDEN" NAME="FILEID" VALUE="$comp_id">
<INPUT TYPE="HIDDEN" NAME="FILENAME" VALUE="$file_name">
To submit the query, press this button: <INPUT TYPE="submit" VALUE="Submit Query"> <P>
</FORM>

An alternative that you might want to play with is changing from method GET to method POST. You should then be able to use your program as it is although this depends on how your cgi-bin.pl program is written. Most standard ones that I have seen check either for one or the other, not both. If however it was modified to accept both then your program should work.

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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