perl

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.



makam_75Asked:
Who is Participating?
 
TintinCommented:
You *can* specify parameter/values in a URL.  You really need to show your code so we can see what it wrong.
0
 
fim32Commented:
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
 
makam_75Author Commented:
But,,, I am unable to retreive the value using $query->param('ReqCode') if I pass <a href="3.cgi?ReqCode=value">
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
TintinCommented:
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
 
makam_75Author Commented:
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
 
TintinCommented:
OK.

What you could do is use a CGI script to read in 2.html and add the appropriate hidden fields.
0
 
makam_75Author Commented:
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
 
TintinCommented:
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
 
makam_75Author Commented:
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
 
TintinCommented:
Did it end up being a coding error then?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.