This is what I had been using as the check based on the code that had been
there previously and along with an email validator that sets $email to
if the address isn't valid. The purpose of the form is lead generation. The
last bit is to prevent spammers from entering urls in the class text box.
Original Message
From: April Mains aprilma...@gmail.com
To:
Cc: PHP-General list php-general@lists.php.net
Sent: Mon, Jun 18, 2012, 9:41 AM
Subject: Re: [PHP] else if vs switch
This is what I had been using as the check based on the code that had been
there previously and along
On 2012-06-18, at 7:59 AM, James wrote:
Original Message
From: April Mains aprilma...@gmail.com
To:
Cc: PHP-General list php-general@lists.php.net
Sent: Mon, Jun 18, 2012, 9:41 AM
Subject: Re: [PHP] else if vs switch
This is what I had been using as the check based on the code
April Mains aprilma...@gmail.com wrote:
On 2012-06-18, at 7:59 AM, James wrote:
Original Message
From: April Mains aprilma...@gmail.com
To:
Cc: PHP-General list php-general@lists.php.net
Sent: Mon, Jun 18, 2012, 9:41 AM
Subject: Re: [PHP] else if vs switch
This is what I had
On 6/15/2012 3:29 PM, Joshua Kehn wrote:
Way easier to just use a map.
$mapping = array(
'Calgary' = abc@emailaddress,
'Brooks' = def@emailaddress,
// etc
);
$toaddress = $mapping[$city];
I would use this, but add a check to it.
$mapping = array(
'default' =
Same logical check with my personal preference ;)
$toaddress = $mapping['default'];
if ( isset($city) isset($mapping[$city]) ) { ... }
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Jim Lucas li...@cmsws.com wrote:
On 6/15/2012 3:29 PM, Joshua Kehn wrote:
Way easier
I have 25 cities and am currently using the following to set the $toaddress for
submitting student pre-registration forms based on the city selected:
if ($city == Calgary) {
$toaddress = abc@emailaddress;
} elseif ($city == Brooks) {
$toaddress = def@emailaddress;
and so on.
Would
Way easier to just use a map.
$mapping = array(
'Calgary' = abc@emailaddress,
'Brooks' = def@emailaddress,
// etc
);
$toaddress = $mapping[$city];
Regards,
–Josh
Joshua Kehn | @joshkehn
http://joshuakehn.com
On Jun 15, 2012, at 6:20
Ah yes that's it.
Thank you for your help. Have a good weekend.
April
On 2012-06-15, at 4:29 PM, Joshua Kehn wrote:
Way easier to just use a map.
$mapping = array(
'Calgary' = abc@emailaddress,
'Brooks' = def@emailaddress,
// etc
);
$toaddress = $mapping[$city];
On 06/15/2012 06:44 PM, April Mains wrote:
Ah yes that's it.
Thank you for your help. Have a good weekend.
April
On 2012-06-15, at 4:29 PM, Joshua Kehn wrote:
Way easier to just use a map.
$mapping = array(
'Calgary' = abc@emailaddress,
'Brooks' = def@emailaddress,
//
10 matches
Mail list logo