Solved

CGI And HTML

Posted on 1997-11-05
8
328 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
ID: 1831096
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
ID: 1831097
The HTML you need is something similar to this:

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

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

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

Expert Comment

by:alamo
ID: 1831098
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
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!

 
LVL 6

Expert Comment

by:alamo
ID: 1831099
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
 

Author Comment

by:dl090597
ID: 1831100
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
ID: 1831101
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
ID: 1831102
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
ID: 1831103
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

Technology Partners: 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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

733 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