Dropdown Menu in PHP

Browsing around the web you'll notice tons of drop-down menus that let you navigate to different areas of that web site.   Drop down menu navigation is great because it lets you add a lot of navigation options, without taking up much space.  I know, for the web dev buffs out there you would probably never want to do this in PHP alone, but I found a cool tidbit of info on this and wanted to share.  So if you're looking for how to do this on a large-scale you probably want to turn to JavaScript.

With that said, one way to replicate a drop down menu with PHP is to setup an HTML form somewhere on your page and have it pass the site's URL to a PHP page when you submit it.  For example:

<form action="jump.php" method="post"> <select name=url> <option value="http://php.about.com">About PHP</option> <option value="http://www.identity.st">Identity</option> </select> <input type="submit" value="Go"> </form>

Then have the PHP file jump.php use basic redirection to send them to the right page.  For example:

<?php $url = $_POST["url"]; header("Location: $url"); ?>

Give it a shot!