Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

perl

Posted on 2004-04-26
10
Medium Priority
?
252 Views
Last Modified: 2010-03-04
Hi,
I have the following programs working well individually.
I am having problems linking them all together.

1.cgi
2.html
3.cgi
4.cgi

Problem A) I want 1.cgi to pass a hidden variable to 2.html

This is what I tried:  
   print "<FORM METHOD=POST action=\"/htdocs/intranet/2.html\">\n";
   print "<INPUT TYPE=\"HIDDEN\" NAME=\"ReqCode\" VALUE=\"$allreqs\">\n";
And this gives me error. Is it because I cannot call an html from a cgi? How else can I do it?

Problem B) In 2.html, I want to have 2 url links as bullets and pass the same hidden variable to 3.cgi and 4.cgi

* Option 1? Click here  (should link to 3.cgi passing parameter ReqCode)
* Option2? Click here   (should link to 4.cgi passing parameter ReqCode)

I cannot have submit buttons, so I am guessing the only way to pass these paramets is by url? I did try
<a href = 3.cgi?name=ReqCode&value=1> But in my 3.cgi, $query->param('ReqCode') does not have any value.
(I don't care if the name-value of the hidden var get displayed on the browser)

How can I resolve these 2 issues?
Thank you.



0
Comment
Question by:makam_75
  • 5
  • 4
10 Comments
 
LVL 7

Assisted Solution

by:fim32
fim32 earned 800 total points
ID: 10923854
problem b is easier:

<a href="3.cgi?ReqCode=value">

problem a... um... i can't see why you wouldn't be able to call an html using a cgi, but i can't see how a web server would pass that html any variables...  it would have to be some shtml, or some other server side processing app... probably easiest as another .cgi script?
0
 

Author Comment

by:makam_75
ID: 10923886
But,,, I am unable to retreive the value using $query->param('ReqCode') if I pass <a href="3.cgi?ReqCode=value">
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10924576
Let's go back a few steps.

I suspect you can combine all four steps in a single Perl/CGI script, but you'll need to tell us exactly what you are trying to acheive.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:makam_75
ID: 10924671
Hello,
I do not want to combine because all the scripts are existing code and working well and cannot justify re-writing it.
It is basically a shopping cart Im trying to do. The html page is once the cart is loaded, providing the user with some options for checkout. But really, i do not want to recode any of those.
Thanks.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10924683
OK.

What you could do is use a CGI script to read in 2.html and add the appropriate hidden fields.
0
 

Author Comment

by:makam_75
ID: 10924906
ok that is what i did. but i stll have the  need to create a href url and pass the name value pairs and accept it in the final script by saying query->param

If a cgi cannot call an html, isnt it a big limitation! im surprised!

0
 
LVL 48

Expert Comment

by:Tintin
ID: 10924965
I suspect you are a little confused by the various web components/technologies.  Remember that a HTML file is a static document.   However, you can make it dynamic by using ASP, PHP, SHTML etc.

In 2.html, you say you have a link

<a href="3.cgi?Reqcode=value">

but the code in 3.cgi doesn't get this value.  If that's the case, then you have a coding/logic problem in 3.cgi, so please post that relevant parts of the code.

0
 

Author Comment

by:makam_75
ID: 10925810
Im using cgi.pm to retreive the values passed frm the previous page.
Guess if i use url method of parameter passing, i cannot use this to retrieve the data...
0
 
LVL 48

Accepted Solution

by:
Tintin earned 1200 total points
ID: 10934050
You *can* specify parameter/values in a URL.  You really need to show your code so we can see what it wrong.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10954270
Did it end up being a coding error then?
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

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

926 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