Hello,
I suggest you put default in that switch statement and var_dump the
$_POST.That should be enough for a programmer to pin point what goes wrong.
P:S
**You might want to consider versioning your codes to go back into its
history to see what has changed.
Muhsin
On 09/29/2013 04:33 AM, Ethan
What is the output?
On Sun, Sep 29, 2013 at 1:34 AM, Ethan Rosenberg <
erosenb...@hygeiabiomedical.com> wrote:
> On 09/28/2013 10:53 PM, Aziz Saleh wrote:
>
>> Ethan, can you do a var_dump instead of print_r. It might be that
>> next_step
>> has spaces in it causing the switch to not match.
>>
>
On 09/28/2013 10:53 PM, Aziz Saleh wrote:
Ethan, can you do a var_dump instead of print_r. It might be that next_step
has spaces in it causing the switch to not match.
Aziz
Aziz -
Used var_dump no further information
Ethan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe
Ethan, can you do a var_dump instead of print_r. It might be that next_step
has spaces in it causing the switch to not match.
Aziz
On Sat, Sep 28, 2013 at 10:33 PM, Ethan Rosenberg <
erosenb...@hygeiabiomedical.com> wrote:
> Dear List -
>
> I have a working program. I made one change in a swit
On Nov 19, 2012, at 2:46 PM, Stuart Dallas wrote:
> On 19 Nov 2012, at 19:35, Tim Streater wrote:
>
>> On 18 Nov 2012 at 14:44, Jim Giner wrote:
>> Just so. Perhaps those who are not grasping the point could re-read their
>> copy of "The Elements of Programming Style" by Kernighan and Plauge
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
wrote:
> On Wed, Jan 19, 2011 at 6:45 AM, Joshua K
On Wed, Jan 19, 2011 at 12:44 PM, Micky Hulse wrote:
> On Wed, Jan 19, 2011 at 6:45 AM, Joshua Kehn 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 sn
On Jan 19, 2011, at 12:44 PM, Micky Hulse wrote:
> On Wed, Jan 19, 2011 at 6:45 AM, Joshua Kehn 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" and/or "python
On Wed, Jan 19, 2011 at 6:45 AM, Joshua Kehn 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 and Vo
.
>>
>> 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
>> experi
> On Tue, Jan 18, 2011 at 23:39, Joshua Kehn 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 who cry and c
On Tue, Jan 18, 2011 at 23:39, Joshua Kehn 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
> done it mor
> 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/
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.
>
>
> Thtt
[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 uns
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. Bes
On Tue, Jan 18, 2011 at 10:53:19PM -0600, Donovan Brooke 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'
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 to
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
--
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 (http://www
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
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/)
T
$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 wrote:
> Hello,
>
> I must not understand PHP's switch/case..
> The case '0' below fires when $t_mssg = "" apparently.
>
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- ";
>
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 wrote:
> Hello,
>
> I must not understand PHP's switch/case..
> The case '0' below fir
On Mon, 2010-11-15 at 22:43 +, Ashley Sheridan wrote:
> On Mon, 2010-11-15 at 16:27 -0500, Steve Staples wrote:
>
> > Ok, dumb question, and i have tested, but I want to ensure that my tests
> > were accurate, and behavior is correct.
> >
> > Ok, i have an integer, that based on what it is, d
On Mon, 2010-11-15 at 16:27 -0500, Steve Staples wrote:
> Ok, dumb question, and i have tested, but I want to ensure that my tests
> were accurate, and behavior is correct.
>
> Ok, i have an integer, that based on what it is, does certain things...
>
> switch ((int)$intval)
> {
> }
>
> now, if
Hi,
I have a code snippet here as in the following:
//Switch statements between the four options
switch($string) {
case "":
$string= "NOT book.author='All'";
break;
default:
$string= $string . "AND NOT book.author='All'";
break;
}
This code does work, but I am wondering if it is possib
Boyd, Todd M. schreef:
>> -Original Message-
>> From: Alice Wei [mailto:aj...@alumni.iu.edu]
>> Sent: Thursday, January 29, 2009 3:02 PM
>> To: php-general@lists.php.net
>> Subject: [PHP] Switch statement Question
>>
>>
>> Hi,
>>
>> I have a code snippet here as in the following:
>>
>> //
> -Original Message-
> From: Alice Wei [mailto:aj...@alumni.iu.edu]
> Sent: Thursday, January 29, 2009 3:02 PM
> To: php-general@lists.php.net
> Subject: [PHP] Switch statement Question
>
>
> Hi,
>
> I have a code snippet here as in the following:
>
> //Switch statements between the f
At 2:18 PM -0600 1/13/09, Micah Gersten wrote:
Jochem Maas wrote:
switch (true) {
case ($x === $y):
// something
> break;
This is a misuse of the switch statement. Switch is meant to compare
values to a single variable as stated on the manual page:
http://us
I regret that I don't recall who made the brilliant observation that
programmers spend the majority of their time *reading* code (their own or
others) as opposed to *writing* code.
So, I make it a point to try to make my code easily scannable. I only and
always use the switch construct when eva
On Tue, 2009-01-13 at 22:12 +0100, Jochem Maas wrote:
> Robert Cummings schreef:
> > On Tue, 2009-01-13 at 15:50 +0100, Jochem Maas wrote:
> >> Ashley Sheridan schreef:
> >>> On Mon, 2009-01-12 at 15:15 -0500, Frank Stanovcak wrote:
> I've googled, and found some confusing answers.
> I've
Micah Gersten wrote:
> Jochem Maas wrote:
>> switch (true) {
>> case ($x === $y):
>> // something
>> break;
>>
>> case ($a != $b):
>> // something
>> break;
>>
>> case (myFunc()):
>> // something
>> break;
Nathan Rixham schreef:
> Jochem Maas wrote:
>> Micah Gersten schreef:
>>> Jochem Maas wrote:
switch (true) {
>
> should be switch(false) {
>
> :-)
>
it could be either depending on your needs, no?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
Robert Cummings schreef:
> On Tue, 2009-01-13 at 15:50 +0100, Jochem Maas wrote:
>> Ashley Sheridan schreef:
>>> On Mon, 2009-01-12 at 15:15 -0500, Frank Stanovcak wrote:
I've googled, and found some confusing answers.
I've tried searching the history of the news group, and only found inf
Jochem Maas wrote:
Micah Gersten schreef:
Jochem Maas wrote:
switch (true) {
should be switch(false) {
:-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Micah Gersten schreef:
> Jochem Maas wrote:
>> switch (true) {
>> case ($x === $y):
>> // something
>> break;
>>
>> case ($a != $b):
>> // something
>> break;
>>
>> case (myFunc()):
>> // something
>> break
I think if they didn't want us to use expressions in the case, then they
wouldn't have put support into the language for that.
I daresay you are reading more into the text than was intended...
I certainly have found switch(true) with complex expressions for case quite
handy and very clear
Jochem Maas wrote:
> switch (true) {
> case ($x === $y):
> // something
> break;
>
> case ($a != $b):
> // something
> break;
>
> case (myFunc()):
> // something
> break;
>
> case ($my->getCh
On Tue, 2009-01-13 at 15:50 +0100, Jochem Maas wrote:
> Ashley Sheridan schreef:
> > On Mon, 2009-01-12 at 15:15 -0500, Frank Stanovcak wrote:
> >> I've googled, and found some confusing answers.
> >> I've tried searching the history of the news group, and only found info on
> >> switch or elseif
On Tue, Jan 13, 2009 at 9:50 AM, Jochem Maas wrote:
> switch (true) {
>case ($x === $y):
>// something
>break;
>
>case ($a != $b):
>// something
>break;
>
>case (myFunc()):
>// something
>
Ashley Sheridan schreef:
> On Mon, 2009-01-12 at 15:15 -0500, Frank Stanovcak wrote:
>> I've googled, and found some confusing answers.
>> I've tried searching the history of the news group, and only found info on
>> switch or elseif seperately. :(
>>
>> Strictly from a performance stand point, n
At 5:12 PM -0500 1/12/09, Robert Cummings wrote:
On Mon, 2009-01-12 at 17:09 -0500, tedd wrote:
At 4:57 PM -0500 1/12/09, Robert Cummings wrote:
>No, that's DIFFERENT from what I wrote. Go back and re-read.
>
>:)
I did and reread again -- it looks different. I'm simply talking
about the s
On Mon, 2009-01-12 at 17:09 -0500, tedd wrote:
> At 4:57 PM -0500 1/12/09, Robert Cummings wrote:
> >No, that's DIFFERENT from what I wrote. Go back and re-read.
> >
> >:)
>
> I did and reread again -- it looks different. I'm simply talking
> about the spacing.
>
> No matter though, it's the sam
At 4:57 PM -0500 1/12/09, Robert Cummings wrote:
No, that's DIFFERENT from what I wrote. Go back and re-read.
:)
I did and reread again -- it looks different. I'm simply talking
about the spacing.
No matter though, it's the same code.
Cheers,
tedd
--
---
http://sperling.com http://
On Mon, 2009-01-12 at 16:49 -0500, tedd wrote:
> At 3:32 PM -0500 1/12/09, Robert Cummings wrote:
> >One has to wonder about the readability of the case version though since
> >one may not notice immediately the missing break statement.
> >
> >Cheers,
> >Rob.
>
> Yes, but that's because of the way
tedd wrote:
At 3:32 PM -0500 1/12/09, Robert Cummings wrote:
One has to wonder about the readability of the case version though since
one may not notice immediately the missing break statement.
Cheers,
Rob.
Yes, but that's because of the way you wrote it -- consider this:
I'm sure that was
On Mon, 2009-01-12 at 16:49 -0500, tedd wrote:
> At 3:32 PM -0500 1/12/09, Robert Cummings wrote:
> >One has to wonder about the readability of the case version though since
> >one may not notice immediately the missing break statement.
> >
> >Cheers,
> >Rob.
>
> Yes, but that's because of the way
At 3:32 PM -0500 1/12/09, Robert Cummings wrote:
One has to wonder about the readability of the case version though since
one may not notice immediately the missing break statement.
Cheers,
Rob.
Yes, but that's because of the way you wrote it -- consider this:
If you group the case's togeth
At 3:15 PM -0500 1/12/09, Frank Stanovcak wrote:
I've googled, and found some confusing answers.
I've tried searching the history of the news group, and only found info on
switch or elseif seperately. :(
Strictly from a performance stand point, not preference or anything else, is
there a benefi
On Mon, Jan 12, 2009 at 4:00 PM, Daevid Vincent wrote:
> On Mon, 2009-01-12 at 15:31 -0500, Eric Butera wrote:
>
>> On Mon, Jan 12, 2009 at 3:15 PM, Frank Stanovcak
>> wrote:
>> > I've googled, and found some confusing answers.
>> > I've tried searching the history of the news group, and only fou
On Mon, 2009-01-12 at 15:31 -0500, Eric Butera wrote:
> On Mon, Jan 12, 2009 at 3:15 PM, Frank Stanovcak
> wrote:
> > I've googled, and found some confusing answers.
> > I've tried searching the history of the news group, and only found info on
> > switch or elseif seperately. :(
> >
> > Strictl
On Mon, Jan 12, 2009 at 3:58 PM, Frank Stanovcak
wrote:
>
> ""Eric Butera"" wrote in message
> news:6a8639eb0901121231r253eed48xe1974d8ef44ab...@mail.gmail.com...
>> On Mon, Jan 12, 2009 at 3:15 PM, Frank Stanovcak
>> wrote:
>>> I've googled, and found some confusing answers.
>>> I've tried sear
""Eric Butera"" wrote in message
news:6a8639eb0901121231r253eed48xe1974d8ef44ab...@mail.gmail.com...
> On Mon, Jan 12, 2009 at 3:15 PM, Frank Stanovcak
> wrote:
>> I've googled, and found some confusing answers.
>> I've tried searching the history of the news group, and only found info
>> on
>
"Ashley Sheridan" wrote in message
news:1231793310.3558.55.ca...@localhost.localdomain...
> On Mon, 2009-01-12 at 15:15 -0500, Frank Stanovcak wrote:
>> I've googled, and found some confusing answers.
>> I've tried searching the history of the news group, and only found info
>> on
>> switch or el
On Mon, 2009-01-12 at 15:15 -0500, Frank Stanovcak wrote:
> I've googled, and found some confusing answers.
> I've tried searching the history of the news group, and only found info on
> switch or elseif seperately. :(
>
> Strictly from a performance stand point, not preference or anything else,
On Mon, 2009-01-12 at 15:15 -0500, Frank Stanovcak wrote:
> I've googled, and found some confusing answers.
> I've tried searching the history of the news group, and only found info on
> switch or elseif seperately. :(
>
> Strictly from a performance stand point, not preference or anything else,
On Mon, Jan 12, 2009 at 3:15 PM, Frank Stanovcak
wrote:
> I've googled, and found some confusing answers.
> I've tried searching the history of the news group, and only found info on
> switch or elseif seperately. :(
>
> Strictly from a performance stand point, not preference or anything else, is
On Sep 13, 2008, at 12:12 PM, Robert Cummings wrote:
On Sat, 2008-09-13 at 10:09 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 5:13 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 16:11
On Sat, 2008-09-13 at 10:09 -0400, Eric Gorr wrote:
> On Sep 12, 2008, at 5:13 PM, Robert Cummings wrote:
>
> > On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote:
> >> On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote:
> >>
> >>> On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote:
> On Sep
On Sep 12, 2008, at 5:13 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote:
I don't see how that in any wa
Well, I've often found the need to treat several conditions with the
same set of statements within a switch:
switch($some_number)
{
case 1:
case 2:
{
// do some shizzle
break;
}
case 3:
{
// foshizzle that nizzle
break;
}
default:
On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote:
> On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote:
>
> > On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote:
> >> On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote:
> >>>
> >>> I don't see how that in any way makes an argument for or against.
On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote:
I don't see how that in any way makes an argument for or against.
Once
still must spend client's money wasting time on code that has
On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote:
> On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote:
> >
> > I don't see how that in any way makes an argument for or against. Once
> > still must spend client's money wasting time on code that has
> > questionable merit. Yes, some debugging code
On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote:
I don't see how that in any way makes an argument for or against. Once
still must spend client's money wasting time on code that has
questionable merit. Yes, some debugging code is a great boon in any
application, but littered everywhere to fu
On Fri, 2008-09-12 at 15:15 -0400, Eric Gorr wrote:
> On Sep 12, 2008, at 2:51 PM, Robert Cummings wrote:
>
> > On Fri, 2008-09-12 at 14:33 -0400, Eric Gorr wrote:
> >> On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote:
> >>
> >>> On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote:
> On Sep
On Sep 12, 2008, at 2:51 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 14:33 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote:
On Fri, Sep 12, 2008 at 9:52 A
On Fri, 2008-09-12 at 14:33 -0400, Eric Gorr wrote:
> On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote:
>
> > On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote:
> >> On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote:
> >>
> >>> On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas <[EMAIL PROTECTED]>
>
On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote:
On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote:
On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote:
On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas <[EMAIL PROTECTED]>
wrote:
Luke schreef:
I wonder if this is a shared trait between C an
At 10:58 AM +0100 9/12/08, Luke wrote:
I wonder if this is a shared trait between C and PHP (since I
understand PHP is written in C) that the break; and the default: are
placed for good practice in all switch statements since they prevent
memory leaks?
First, the evolution of computer languag
On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote:
> On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote:
>
> > On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas <[EMAIL PROTECTED]>
> > wrote:
> >> Luke schreef:
> >>>
> >>> I wonder if this is a shared trait between C and PHP (since I
> >>> underst
On Fri, 2008-09-12 at 10:58 +0100, Luke wrote:
> I wonder if this is a shared trait between C and PHP (since I understand PHP
> is written in C) that the break; and the default: are placed for good
> practice in all switch statements since they prevent memory leaks?
Prevent memory leaks? WHAT?
Ev
On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote:
On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas <[EMAIL PROTECTED]>
wrote:
Luke schreef:
I wonder if this is a shared trait between C and PHP (since I
understand
PHP
is written in C) that the break; and the default: are placed for
good
On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Luke schreef:
>>
>> I wonder if this is a shared trait between C and PHP (since I understand
>> PHP
>> is written in C) that the break; and the default: are placed for good
>> practice in all switch statements since they prev
Luke schreef:
I wonder if this is a shared trait between C and PHP (since I understand PHP
is written in C) that the break; and the default: are placed for good
practice in all switch statements since they prevent memory leaks?
default is not required, never heard it was good practice to always
I wonder if this is a shared trait between C and PHP (since I understand PHP
is written in C) that the break; and the default: are placed for good
practice in all switch statements since they prevent memory leaks?
2008/9/10 Jochem Maas <[EMAIL PROTECTED]>
> tedd schreef:
>
> At 6:46 PM -0600 8/31
tedd schreef:
At 6:46 PM -0600 8/31/08, Govinda wrote:
Not that it is an issue, but just to understand the logic-
Why do we have to use 'break' statements in each case?
switch ($i) {
case 0:
echo "i equals 0";
break;
case 1:
echo "i equals 1";
break;
case 2:
echo "i equals 2
At 6:46 PM -0600 8/31/08, Govinda wrote:
Not that it is an issue, but just to understand the logic-
Why do we have to use 'break' statements in each case?
switch ($i) {
case 0:
echo "i equals 0";
break;
case 1:
echo "i equals 1";
break;
case 2:
echo "i equals 2";
break;
}
Govinda schreef:
Not that it is an issue, but just to understand the logic-
Why do we have to use 'break' statements in each case?
switch ($i) {
case 0:
echo "i equals 0";
break;
case 1:
echo "i equals 1";
break;
case 2:
echo "i equals 2";
break;
}
all 3 cases fire, even
> What you're saying in that case is either col_1 evaluates to value1 or
> col_2 evaluates to value2.
Correct. To be more specific (it was better I did from begining :))
After an "order" is submitted, the code is checking are there any coments
about tax charges (col_1) and/or billing charges (col_2
On Tuesday 29 August 2006 14:12, [EMAIL PROTECTED] wrote:
> No. They are two if statements because they are indepedent.
>
> > On Tuesday 29 August 2006 13:44, Ray Hauge wrote:
> >> Using a switch like this is more equivalent of
> >>
> >> if(something){
> >> // true
> >> } else {
> >> // false
> >>
No. They are two if statements because they are indepedent.
> On Tuesday 29 August 2006 13:44, Ray Hauge wrote:
>> Using a switch like this is more equivalent of
>>
>> if(something){
>> // true
>> } else {
>> // false
>> }
>
> Actually, it's more like an if/elseif/else (if you use default:) or
>
Means, my first solution was the only solution.
Thanks.
-afan
> Using a switch like this is more equivalent of
>
> if(something){
> // true
> } else {
> // false
> }
>
> You're doing :
>
> if(something1){
> // true 1
> }
>
> if(something2){
> // true2
> }
>
> hope that helps.
>
> --
> Ray Haug
On Tuesday 29 August 2006 13:44, Ray Hauge wrote:
> Using a switch like this is more equivalent of
>
> if(something){
> // true
> } else {
> // false
> }
Actually, it's more like an if/elseif/else (if you use default:) or if/elseif
(without default:)
--
Ray Hauge
Programmer/Systems Administrato
On Tuesday 29 August 2006 13:31, [EMAIL PROTECTED] wrote:
> I have something like this:
>
> $query = mysql_query("
> SELECT col_1, col_2
> FROM table
> ");
> $result = mysql_fetch_array($query);
> if ($result['col_1'] == 'value_1')
> {
> // do something
> }
Ford, Mike wrote:
How about something like:
switch
Beware that PHP_SELF is injectable like several other $_SERVER
variables, so you must at least encode it to prevent XSS attacks.
Eg. http://example.com/foo.php/";>
At 12:44 PM +0100 8/23/06, Ross wrote:
At the moment I have this, but I want to change it to one switch button
I think I know what you mean -- a single switch button.
Please review this kiddie-script:
http://xn--ovg.com/a/toggle.php
hth's
tedd
--
---
http://sperling.com http://ancients
On 23 August 2006 12:45, Ross wrote:
> At the moment I have this, but I want to change it to one
> switch button
>
> switch it.
> I
>
> have tried but keep getting wrapped up in nested if-else statements.
> Does anyone know how to make an efficient one button on-off switch.
>
>
>
> $sessio
[snip]
At the moment I have this, but I want to change it to one switch button
switch
it.
I have tried but keep getting wrapped up in nested if-else statements.
Does
anyone know how to make an efficient one button on-off switch.
[/snip]
Have you considered a switch statement? http://www.php.n
Hey,
> Can I jump to html and back to php in the middle on switch
yes, you can.
Question: I know this might sound silly but why didnt you try it before
writing to the list?
you would have gotten your answer much quicker.
Cheers,
Ryan
--
No virus found in this outgoing message.
Checked by AV
William Stokes wrote:
Hello,
Can I jump to html and back to php in the middle on switch
Test the question.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
Can I jump to html and back to php in the middle on switch
[/snip]
Yes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lancer Emotion 16 wrote:
>
>
>
>
>
>
> Now, in page.php is possible to do a switch of form name? Something like
> this :
>
> Switch ($_POST['form'] {
> 'form1' : ...
> 'form2' : ...
> }
>
> If this is possible,i dont know how to call it, can you help me please?
The NAME attribut
[snip]
Hi list,I have 2 forms :
Now, in page.php is possible to do a switch of form name? Something like
this :
Switch ($_POST['form'] {
'form1' : ...
'form2' : ...
}
If this is possible,i dont know how to call it, can you help me please?
[/snip]
Do this...
switch
> Oh... you know, I've gotta stop leaving my brain at home. Thanks Chris,
> R'twick.. It sure is a relief to know that this list is here when I'm
> having bad PHP days.. which lately, is everyday... This solved my problem
> perfectly.
np.
We've all had our brain fart days. Or weeks. :p
Ch
Hi,
> Just do a conditional break.
> case 0:
> blah blah blah.
> if (my condition == false)
> break;
> case 1:
> blah blah ..
Oh... you know, I've gotta stop leaving my brain at home. Thanks Chris,
R'twick.. It sure is a relief to know that th
On 19 Jun 2003 at 13:52, Dan Joseph wrote:
> Hi All,
>
> Looking for some guidance on something I want to be able to do with switch,
> and I don't think it exists, but I'd like to consult the list as a last
> resort.
>
> I have a switch setup similar to:
>
> switch ($step) {
>
> I have a switch setup similar to:
> Under case 0, I'd like to do a few things, and then if a certain condition
> is met, move into case 1. Is this possible? Am I off the wall here? Is
> there a better way of doing this madness I've come up with?
Just do a conditional break.
Chris
--
PHP G
1 - 100 of 138 matches
Mail list logo