Solved

CGI And HTML

Posted on 1997-11-05
8
321 Views
Last Modified: 2013-12-25
I have four options on a HTML page i.e.

Option 1.
Option 2.
Option 3.
Option 4.

I would like the user to choose anyone of the above options and, the chosen option would execute a cgi script.  Note each option excutes a different cgi script.

Can somebody provide me with the required HTML thanks.
0
Comment
Question by:dl090597
  • 3
  • 3
  • 2
8 Comments
 
LVL 6

Expert Comment

by:alamo
Comment Utility
You can't do this in straight html. You can do it with javascript but if someone doesn't have javascript they are stuck.

You can do it by calling a script which turns around and activates the correct script. Do you need to pass other form data to these scripts? POST or GET? Are all these scripts yours, on the same machine? The answers to these questions dictate exactly what the solution is.
0
 

Accepted Solution

by:
gambito042797 earned 50 total points
Comment Utility
The HTML you need is something similar to this:

<a href="http://www.yourdomain.xxx/path/yourprogram1.cgi?parameter1&parameter2&otherparameters>
Option 1: Name of option 1 </a>

<a href="http://www.yourdomain.xxx/path/yourprogram2.cgi?parameter1&parameter2&otherparameters>
Option 2: Name of option 2 </a>

....
other options
....
0
 
LVL 6

Expert Comment

by:alamo
Comment Utility
dl, I interpreted your question as "I have a form with four option buttons or command buttons" and you wanted the user to essentially choose which of four scripts the form data gets submitted to. Perhaps I read too much into it, gambito has given you a page with 4 simple links. If I was wrong about your problem  reject my answer and let him post one.
0
 
LVL 6

Expert Comment

by:alamo
Comment Utility
oops, I got this confused with another question where I posted an  answer rather than as a comment, never mind nothing to reject unless I was right originally in my reading of the question :-)
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:dl090597
Comment Utility
Gambito,

If I have a hidden field on HTML form which contains a value, that I need to pass to each of the different script ie.

<INPUT TYPE=HIDDEN NAME="ID" VALUE="<#ID>">

where #ID is value.

How can this be integrated into the answer you have provide me.

Thanks
0
 

Expert Comment

by:gambito042797
Comment Utility
The meaning of hidden fields in the form protocol is to manage that the form sends back to your program fixed data not updatable by the user who fills your form. Then, in the case of a directly put call to your program, you can put the hidden field as a parameter in your call.

<a href="http://www.yourdomain.xxx/path/yourprogram?paramter1=value1?ID=#ID?otherparameters> optionmenu </a>

...where ID is the name of your hidden field and #ID is the value.


0
 

Author Comment

by:dl090597
Comment Utility
Gambito,

I trying to test my CGI, however the payments.exe CGI doesn't seem to get execute.  Any ideas.  Here is my code:

<HTML>
<HEAD>
<LINK HREF="file://localhost/Payments.exe"?CLIENTID=#CLIENTID">
<BODY>
<H1>Options</H1>
<HR>
<P>
<H2>Choose an option:</H2>
<A HREF="file://localhost/Payments.exe"> View your payments </A><BR>
<P>
<INPUT TYPE=HIDDEN NAME="CLIENTID" VALUE="<#CLIENTID>">
</BODY>
</HEAD>
</HTML>

Thanks
0
 

Expert Comment

by:gambito042797
Comment Utility
Hi DL, seems that you have made many mistakes in your code,
have you tested it really?

Following you have your CGI call in two flavours, with links
and with forms.

Hope this helps and please, excuse if my english is
not very good.

This first one is the version with menus

<HTML>
<HEAD>

<!-- LINK, VLINK, and ALINK attributes
      These attributes allow control over the link text colouring.
        VLINK stands for visited link, and ALINK stands for active link.
        The default colouring of these is: LINK=blue (#0000FF),
        VLINK=purple (#400040), and ALINK=red (#FF0000). Again,
        the format for these attributes is the same as that for BGCOLOR and TEXT.

        Follows the way to use them.
-->
</head>
<BODY LINK="#rrggbb" VLINK="#rrggbb" ALINK="#rrggbb">

<H1>Options</H1>
<HR>
<P>
<H2>Choose an option:</H2>
<A HREF="http://localhost/Payments.exe?CLIENTID=<#CLIENTID>"> menu 1: View your payments </A><BR>
<P>
</BODY>
</HTML>

*************************************************+
and this one is the version with forms

<HTML>
<HEAD>

<!-- LINK, VLINK, and ALINK attributes
      These attributes allow control over the link text colouring.
        VLINK stands for visited link, and ALINK stands for active link.
        The default colouring of these is: LINK=blue (#0000FF),
        VLINK=purple (#400040), and ALINK=red (#FF0000). Again,
        the format for these attributes is the same as that for BGCOLOR and TEXT.

        Follows the way to use them.
-->
</head>
<BODY LINK="#rrggbb" VLINK="#rrggbb" ALINK="#rrggbb">

<H1>Options</H1>
<HR>
<P>
<H2>Choose an option:
<form action="http://localhost/Payments.exe" method="POST"
 menu 1: View your payments
 <INPUT TYPE=HIDDEN NAME="CLIENTID" VALUE="<#CLIENTID>">
 <input type="submit" name="Send" value="Send choice">
</H2>
<P>
</BODY>
</HTML>

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

728 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

13 Experts available now in Live!

Get 1:1 Help Now