Hello,
I would like to put a select box on my site for navigation purposes. I have seen this done with JavaScript, but I would rather use PHP. The code I wrote dosen’t work and I was wondering if someone in here might tell me why and possibly, how to fix it.
The site is here: [url]http://blackmarketculture.com/artists/jessereno/main.php
Here’s the broken stuff:
[code=php]
<form method=”post” action=”main.php”>
<select name=”nav” value=”nav”>
<option value=”http://www.pig.com”>PIG</option>
<option value=”http://www.pig.com”>PIG</option>
<option value=”http://www.pig.com”>PIG</option>
<option value=”http://www.pig.com”>PIG</option>
</select>
<input type=”submit” name=”submit” value=”go” />
</form>
<?php
$nav = {$_POST[‘nav’]};
if (isset ($_POST[‘submit’]))
{ header( ‘location: ‘ . $nav ); exit(); } ?>
I might also mention that I am using output buffering on this page.
Thanks to anyone who can help…