Solved

CGI And HTML

Posted on 1997-11-05
8
326 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specific format 21 197
WCAG (Web Content Accessibility Guidelines) levels 3 86
Auto-indent certain lines in Notepad++ 10 75
How to create a textarea which saves text in HTML 8 37
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

770 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