Division of Information Technology
Web Publishing @ SFSU
Redirect CGI

Using Redirect

The Redirect cgi program allows you to place a pulldown menu on your page. When a user selects an item from the menu and clicks go they are redirected to that page.

An Example menu


The Form code

The first part of using the program is to design your form. Look at our online Forms instructions or NCSA's information on Forms. For this cgi only the "select" form object is used.

The HTML form will start with the form tag

<form method="post" action="/cgi-bin/redirect.cgi">
<select name="url">

Each item in your menu will require the line

<option value=URL>Menu Item</option>

Where URL is the locations of the website and Menu Item is the name as it will appear on the pop down menu.

In this example the first item a blank URL with the text "Choose a Site" to direct the visitor on using this menu.

<option selected=selected value="">Choose a Site</option>

And Close the form with

</form>

The complete code will look similiar to this.

<form method="post" action="/cgi-bin/redirect.cgi">

<select name="url">
<option selected=selected value="">Choose a Site</option>
<option value="http://www.sfsu.edu/"">SFSU</option>
<option value="http://home.netscape.com/">Netscape</option>
<option value="http://www.yahoo.com/">Yahoo!</option>
</select> <input type="submit" value="Go">
</form>




SFSU Home   Search   Need Help?  

1600 Holloway Avenue, San Francisco, CA 94132 (415) 338-1111
Last modified February 11, 2008 by the Web Team