Site Navigation3. PHP Script |
|
Join the DiscussionMore of this FeatureIntroduction Drop Down Navigation Javascript Only No Button Navigation All Browsers Combo Box Combo Navigator Not Found It may seem strange to be providing a server side script given that this site is all about Javascript but site navigation is important enough that we want the navigation to work for as many visitors as possible including those whose browsers are not Javascript enabled. By using a server side script we can cater for those visitors while using Javascript to make the drop down navigation even easier to use for those whose browsers support it. If we have web hosting that supports PHP then save the following code as xfer.php and the Go! button in our form will transfer your visitors to the selected page:
<?
$xfer = $_POST['xfer']; header("location: $xfer"); ?> Where the server supports a different language you can create the equivalent of this code in that language and change the action field in the form tag to refer to that script instead. If you don't have access to install server side scripts then you will want to use a Javascript Only solution. Let's look at that option next. Note that the script and the descriptions of the functions that it contains are rewritten from the "Ask Felgall" website with the permission of the copyright owner. |

