Solved

perl

Posted on 2004-04-26
10
210 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 200 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
 

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
OTRS Installation 1 276
Perl strange behaviour 5 63
Perl, group, sort, count question 6 107
Perl script to delete older files 6 43
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

707 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

12 Experts available now in Live!

Get 1:1 Help Now