I'm not quite following what you are trying to do in this script, but I'll make an educated guess :p. Are you just trying to make a redirect script that will allow users to jump to a different part of the site or another web address? If so, read on.. if not, sorry for the inconvenience.
to make "jump to" and redirection scripts, the HEADER() function is every useful for this. its format is simple...
header (Location: "http://webaddress.com");
using an html page containing a selection form and if statements in a php page using header makes it possible to create this jump/goto page script. here is some example code:
HTML PAGE:
FORM method="POST" action="redirect.php">
<P>I want to go to:
<SELECT name="id" size="1">
<OPTION value="prima">Prima-Tech</OPTION>
<OPTION value="php">PHP.net</OPTION>
<OPTION value="slashdot">Slashdot</OPTION>
<OPTION value="linuxchix">Linuxchix</OPTION>
</SELECT>
<INPUT type="submit" value="Go!">
</FORM>
Corresponding PHP page:
<?php
if ($id == "prima") {
$location = "http://www.prima-tech.com";
} else if ($id == "php") {
$location = "http://www.php.net";
} else if ($id == "slashdot") {
$location = "http://www.slashdot.org";
} else if ($id == "linuxchix") {
$location = "http://www.linuxchix.org";
}
header("Location: $location");
exit;
?>
modify this script, of course, to suit your own needs. ALSO! very important note. the header information MUST begin at the beginning of the php page so that it is called before any other information is sent to the browser. if the header stuff isn't first, u'll get an error. hope this helps
blue