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.\n";
Thanks To Everyone,
j
--
http://jimlong.net/web
> I'd do something similar to thi
On Sat, 27 Apr 2002, Philip Olson wrote:
> 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 :)
As an early Christmas present, here's the array (to save the OP some
typing - I'm post
Hi,
Make an array $arr of all the states and loop
$state = "AR";
$arr = array();
array_push($arr, "AL", "AR", "AZ");
foreach ($arr as $key => $value)
{
if ($state == $value){
include("Calc$value.class.inc");
}
}
Cheers,
Pekka
http://photography-on-the.net/
At 4/27/2002, you wrote:
>H
ease select a State.\n";
>
> --
> Stuart
>
> -Original Message-
> From: Jim Long [mailto:[EMAIL PROTECTED]]
> Sent: 27 April 2002 20:00
> To: php
> Subject: [PHP] simplify if/then statement
>
>
> Hi,
>
> I've got the following sta
On Sat, 27 Apr 2002, Jim Long wrote:
> I've got the following statement for a state options menu.
> How can this be expressed in a simple manner for all 52 states?
switch(strtolower($state))
{
case 'al':
include 'CalcALclass.inc';
break;
case 'ar':
include 'CalcALclass.inc';
On Sunday 28 April 2002 02:59, Jim Long wrote:
> Hi,
>
> I've got the following statement for a state options menu.
> How can this be expressed in a simple manner for all 52 states?
>
>
> //choose state
>
> if ($state == "AL") {
>
> // include class
> include("CalcAL.class.inc");
> }
>
> else if
$incfilename = "Calc".$state.".class.inc";
if (file_exists($incfilename))
include($incfilename);
else
echo "Please select a State.\n";
--
Stuart
-Original Message-
From: Jim Long [mailto:[EMAIL PROTECTED]]
Sent: 27 April 2002 20:00
To:
Hi,
I've got the following statement for a state options menu.
How can this be expressed in a simple manner for all 52 states?
//choose state
if ($state == "AL") {
// include class
include("CalcAL.class.inc");
}
else if ($state == "AR") {
// include class
include("CalcAR.class.inc");
}
e
8 matches
Mail list logo