note 51754 deleted from control-structures.elseif by felipe
| From: | felipe@php.net | Date: | Tue, 29 Jan 2008 11:13:07 +0000 |
| Subject: | note 51754 deleted from control-structures.elseif by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135505@lists.php.net to get a copy of this message | ||
Note Submitter: mega0m3ga at yahoo dot com
----
Dont make your code as jumbled up as this:
if (!$username || !$password) {
echo("<form method='post' action='signin.php'>");
} elseif($action == "c" || $action == "d" || $action == "e" || $action
== "f" || $action == "g" || $action == "h" || $action ==
"i") {
echo("<form method='post' action='" . findbattle() .
".php'><input type='hidden' name='strt'
value='y'>");
} elseif($action == "b") {
die ("Sorry, dude. You're banned from this site!");
} else {
echo("<form method='post' action='game.php'>");
}
It works best when you only compare related variables.