Solved

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

Posted on 1997-05-20
2
356 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

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…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

733 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