Solved

CGI And HTML

Posted on 1997-11-05
8
329 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
[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
  • 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
Stressed Out?

Watch some penguins on the livecam!

 
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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

724 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