Re: [PHP] switch case madness

2011-01-19 Thread Joshua Kehn
On Jan 18, 2011, at 11:53 PM, Donovan Brooke wrote: The idea of using existing resources for efficiency is very valid indeed.. especially with a job at hand. But, there are good reasons to roll-your-own... education and knowing your own code are 2 that are important to me right now.

RE: [PHP] switch case madness

2011-01-19 Thread Jay Blanchard
[snip] ... [/snip] Imagine when there'll be the day when you do not have to code at all...just copy 'n paste snippets together in the order that you wish them to work in and Voila'! - instant web app. Th!! -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] switch case madness

2011-01-19 Thread Joshua Kehn
On Jan 19, 2011, at 9:43 AM, Jay Blanchard wrote: [snip] ... [/snip] Imagine when there'll be the day when you do not have to code at all...just copy 'n paste snippets together in the order that you wish them to work in and Voila'! - instant web app.

Re: [PHP] switch case madness

2011-01-19 Thread Marc Guay
Imagine when there'll be the day when you do not have to code at all...just copy 'n paste snippets together in the order that you wish them to work in and Voila'! - instant web app. I have a Wordpress plugin that will do all of that for you. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] switch case madness

2011-01-19 Thread Daniel Brown
On Tue, Jan 18, 2011 at 23:39, Joshua Kehn josh.k...@gmail.com wrote: Why not use one of the countless, not to mention secure and stable cookie management systems available? If it's an exercise cool, I misunderstood. I'm not one to normally shun people rolling their own code, lord knows I've

Re: [PHP] switch case madness

2011-01-19 Thread Joshua Kehn
On Tue, Jan 18, 2011 at 23:39, Joshua Kehn josh.k...@gmail.com wrote: The use of existing packages is so increasingly prevalent that I have the unfortunate displeasure of knowing many developers who do nothing but this, yet who can't even answer simple questions about general coding, and

Re: [PHP] switch case madness

2011-01-19 Thread David Hutto
.    I do see from where it is you're coming, though, Josh --- once you've gotten the fundamentals, a lot of times it's easier - sometimes even a better idea - to use an existing, mature solution.  What helps you to determine its value from a code standpoint?  Your existing experience. --

Re: [PHP] switch case madness

2011-01-19 Thread Micky Hulse
On Wed, Jan 19, 2011 at 6:45 AM, Joshua Kehn josh.k...@gmail.com wrote: On Jan 19, 2011, at 9:43 AM, Jay Blanchard wrote: [snip] ... [/snip] Imagine when there'll be the day when you do not have to code at all...just copy 'n paste snippets together in the order that you wish them to work in

Re: [PHP] switch case madness

2011-01-19 Thread Joshua Kehn
On Jan 19, 2011, at 12:44 PM, Micky Hulse wrote: On Wed, Jan 19, 2011 at 6:45 AM, Joshua Kehn josh.k...@gmail.com wrote: They have that. It's called Ruby on Rails. CodeIgniter and/or Django (Python) are fun. What about a middle of the road solution? Google for php micro framework

Re: [PHP] switch case madness

2011-01-19 Thread Adam Richardson
On Wed, Jan 19, 2011 at 12:44 PM, Micky Hulse mickyhulse.li...@gmail.comwrote: On Wed, Jan 19, 2011 at 6:45 AM, Joshua Kehn josh.k...@gmail.com wrote: On Jan 19, 2011, at 9:43 AM, Jay Blanchard wrote: [snip] ... [/snip] Imagine when there'll be the day when you do not have to code at

RE: [PHP] switch case madness

2011-01-19 Thread Richard Sharp
LOL, so true -Original Message- From: Adam Richardson [mailto:simples...@gmail.com] Sent: Wednesday, January 19, 2011 12:28 PM To: PHP-General Subject: Re: [PHP] switch case madness On Wed, Jan 19, 2011 at 12:44 PM, Micky Hulse mickyhulse.li...@gmail.comwrote: On Wed, Jan 19, 2011

[PHP] switch case madness

2011-01-18 Thread Donovan Brooke
Hello, I must not understand PHP's switch/case.. The case '0' below fires when $t_mssg = apparently. Is this how it's suppose to work? I would think it would only fire if it equaled 0. -- print -$t_mssg- br /; if (isset($t_mssg)) { switch ($t_mssg) { case 0:

Re: [PHP] switch case madness

2011-01-18 Thread Chen Dong
Hi, If it is a string 0, you should use: case 0. Because in PHP, 0 == false == null. You need to know the difference between == and ===. Regards, Dong Chen On Wed, Jan 19, 2011 at 2:30 PM, Donovan Brooke li...@euca.us wrote: Hello, I must not understand PHP's switch/case.. The case '0'

Re: [PHP] switch case madness

2011-01-18 Thread Joshua Kehn
On Jan 18, 2011, at 10:30 PM, Donovan Brooke wrote: Hello, I must not understand PHP's switch/case.. The case '0' below fires when $t_mssg = apparently. Is this how it's suppose to work? I would think it would only fire if it equaled 0. -- print -$t_mssg- br /;

Re: [PHP] switch case madness

2011-01-18 Thread Mujtaba Arshad
$t_mssg = 0 is different from $t_mssg = 0 (in all languages, as far as I know, maybe not in python, but I don't know python) On Tue, Jan 18, 2011 at 10:30 PM, Donovan Brooke li...@euca.us wrote: Hello, I must not understand PHP's switch/case.. The case '0' below fires when $t_mssg =

Re: [PHP] switch case madness

2011-01-18 Thread Donovan Brooke
Thanks. I had initialized $t_mssg as an empty string further up the chain out of old habit.. removed that, and now it works... just built my first basic cookie-based PHP/MySQL log-in script from scratch! ;-) Fun stuff, Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] switch case madness

2011-01-18 Thread Joshua Kehn
On Jan 18, 2011, at 11:01 PM, Donovan Brooke wrote: Thanks. I had initialized $t_mssg as an empty string further up the chain out of old habit.. removed that, and now it works... just built my first basic cookie-based PHP/MySQL log-in script from scratch! ;-) Fun stuff, Donovan

Re: [PHP] switch case madness

2011-01-18 Thread Donovan Brooke
-- D Brooke I just died a bit on the inside. Why would you build that from scratch? Regards, -Josh Alright, I'll bite (since I affected you that much) ;-), do tell... Why not? Would you rather I use PHP's session_start()? Donovan -- D Brooke -- PHP General Mailing List

Re: [PHP] switch case madness

2011-01-18 Thread Joshua Kehn
On Jan 18, 2011, at 11:33 PM, Donovan Brooke wrote: -- D Brooke I just died a bit on the inside. Why would you build that from scratch? Regards, -Josh Alright, I'll bite (since I affected you that much) ;-), do tell... Why not? Would you rather I use PHP's

Re: [PHP] switch case madness

2011-01-18 Thread Donovan Brooke
Why not use one of the countless, not to mention secure and stable cookie management systems available? If it's an exercise cool, I misunderstood. I'm not one to normally shun people rolling their own code, lord knows I've done it more then once or twice, but there are some things I wouldn't