Solved

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

Posted on 1997-05-20
2
359 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
[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
2 Comments
 

Author Comment

by:dcs0ock
ID: 1828052
Edited text of question
0
 
LVL 5

Accepted Solution

by:
icd earned 20 total points
ID: 1828053
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

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

717 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