Re: simplify if/then statement
| From: | Jim Long | Date: | Sat, 27 Apr 2002 19:57:43 +0000 |
| Subject: | Re: simplify if/then statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94935@lists.php.net to get a copy of this message | ||
Using pull down for $state.
This works great!
> $incfilename = "Calc".$state.".class.inc";
> if (file_exists($incfilename))
> include($incfilename);
> else
> echo "Please select a State.<br>\n";
Thanks To Everyone,
j
--
http://jimlong.net/web
> I'd do something similar to this, along with
> putting all states in an array to make sure
> $state is actually a state (in_array). And
> maybe you want to add guam :)
>
> a) be sure $state is set, else load default
> b) be sure $state is not bogus, else yell at them
> c) be sure the $state file exists, if so, include
> it else houston we have a problem