[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

CGI And HTML

Posted on 1997-11-05
8
Medium Priority
?
334 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 150 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
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.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses
Course of the Month19 days, 19 hours left to enroll

873 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