Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Link to cgi program without form

Posted on 1999-07-22
8
Medium Priority
?
222 Views
Last Modified: 2010-04-09
Hi,

Is it possible to have a standard link on an html page that links to a cgi program but passes a fixed value to the cgi program without using a form textbox and a submit button?

If so, what is the syntax?

More details:

I have cgi prog. that outputs a large html table from a database, for each record in the table there is more information which I wish to link to. This extra info. is also in the DB so another cgi prog. is required to return the data as a screen full of html. There are too many records to write a CGI prog. for each, so I want one program that is linked to by all the records but each passes it a unique record number so it knows which record to output in detail.

Thanks in advance

 
0
Comment
Question by:andyknott
[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
  • 2
  • 2
  • +2
8 Comments
 
LVL 9

Expert Comment

by:TTom
ID: 1852243
I'm NOT really an expert at this, but I think something like

<a href="mycgiprog.pl?passthisvar='myvalue'">

would work.  I have seen similar constructs a number of times.  I've just never done it myself.

HTH,

Tom
0
 
LVL 1

Expert Comment

by:TheMadManiac
ID: 1852244
Actually, the URL you would give would be without the single quotes


<A HREF="cgi-program?param1name=param1value&param2name=param2value">My link to a cgi program with parameters!</A>

This should work. However, some cgi programs make a distinction between a GET and a POST (this is a GET).

Floris
0
 
LVL 1

Expert Comment

by:Crawford
ID: 1852245
Don't forget to properly URL-escape the query string (that's
everything past the question-mark).
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:andyknott
ID: 1852246
Thanks very much, thats exactly what I wanted and it works fine. Submit your comments as an answer and I'll grade it.
0
 
LVL 9

Expert Comment

by:TTom
ID: 1852247
ak:

There have been comments from three of us on this.  My vote goes to theMadManiac for the points (since my original answer would probably not work).  However, I will take them, if you wish <G>.

Tom
0
 

Author Comment

by:andyknott
ID: 1852248
Hi Tom,

I'll give the grade to theMadManiac if they respond by early next week, otherwise please feel free to submit your comments as an answer.

Thanks for your efforts, I'm sure I would have worked out the exact syntax from your comment but as I didn't get back here until several comments had been added I used theMadmaniacs comment.
0
 
LVL 1

Expert Comment

by:timberbt
ID: 1852249
For technical reasons, I think it would be better form to do it through a form.  The form would have no visible fields, but instead use hidden fields to hold those default values.  That way you keep the standard of the .cgi programs and also keep control of the GET and/or POST methods.

0
 
LVL 1

Accepted Solution

by:
TheMadManiac earned 80 total points
ID: 1852250
welp i'll answer then :)

The thing with a form is that you dont see the long url.. and that some browsers/servers have problems with too long urls. However, they work the same way in the end.

Also, in a form the values are automatically URL encoded (which can be nice)

However, that was not the question :-)

Floris
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

705 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