RE: [PHP-WIN] This crazy code works, but is this the correct and elegant way on 4.21 ?
| From: | Christian Leberfinger | Date: | Mon, 24 Jun 2002 08:29:04 +0000 |
| Subject: | RE: [PHP-WIN] This crazy code works, but is this the correct and elegant way on 4.21 ? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14362@lists.php.net to get a copy of this message | ||
No.
This is the most elegant way I'm aware of:
<?php
if (isset($_POST['location']) AND $_POST['location'] != "" AND
$_POST['location'] != "none") {
header("Location: ".$_POST['location']);
} else {
echo "Select one site to go ";
?>
<FORM method = "POST" action ="">
<SELECT name = "location" size = "1">
<OPTION value = "none">None</OPTION>
<OPTION value = "http://www.microsoft.com/">Microsoft</OPTION>
<OPTION value = "http://www.altavista.com/">Altavista</OPTION>
<OPTION value = "http://php.net/">Php.net</OPTION>
</SELECT>
<Input type = "submit" Value = "GO"></FORM>
<?php
} //endif
?>