[PHP] else if vs switch

2012-06-15 Thread April Mains
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. Wo

Re: [PHP] else if vs switch

2012-06-15 Thread April Mains
gt; "def@emailaddress", > // etc > ); > $toaddress = $mapping[$city]; > > Regards, > > –Josh > > Joshua Kehn | @joshkehn > http://joshuakehn.com > > On Jun 15, 2012, at 6:20 PM, April Mains wrote: > >

Re: [PHP] else if vs switch

2012-06-18 Thread April Mains
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.

Re: [PHP] else if vs switch

2012-06-18 Thread April Mains
On 2012-06-18, at 7:59 AM, James wrote: >> Original Message >> From: April Mains >> To: >> Cc: "PHP-General list" >> Sent: Mon, Jun 18, 2012, 9:41 AM >> Subject: Re: [PHP] else if vs switch >> >> This is what I had been u