Re: [PHP] Switch Statement

2013-09-29 Thread Aziz Saleh
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. Aziz

Re: [PHP] Switch Statement

2013-09-29 Thread mrfroasty
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,

[PHP] Switch Statement

2013-09-28 Thread Ethan Rosenberg
Dear List - I have a working program. I made one change in a switch statement, and it does not work. I'm probably missing something fundamental. Here are some code SNIPPETS... [please note that all my debug statements are at the left margin] Setup... ?php session_start();

Re: [PHP] Switch Statement

2013-09-28 Thread Aziz Saleh
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 switch

Re: [PHP] Switch Statement

2013-09-28 Thread Ethan Rosenberg
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 snip Aziz - Used var_dump no further information Ethan -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Switch statement Question

2009-01-30 Thread Thodoris
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 possible in

[PHP] Switch statement Question

2009-01-29 Thread Alice Wei
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 possible in

RE: [PHP] Switch statement Question

2009-01-29 Thread Boyd, Todd M.
-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 four options

Re: [PHP] Switch statement Question

2009-01-29 Thread Jochem Maas
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: //Switch statements

[PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread CF High
Hey all. In Cold Fusion I was able to do the following: CFSWITCH expression = #action# CFCASE value = getUpdate,getDelete Do Stuff /CFCASE /CFSWITCH Note the comma delimited set of values for the case. Is there a way to do this in php?( i.e. if any of the comma

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Martin Towell
PROTECTED] Subject: [PHP] Switch Statement || Case with multiple values? Hey all. In Cold Fusion I was able to do the following: CFSWITCH expression = #action# CFCASE value = getUpdate,getDelete Do Stuff /CFCASE /CFSWITCH Note the comma delimited set of values

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
more flexible than comma delimited values ... -Original Message- From: CF High [mailto:[EMAIL PROTECTED] Sent: Sunday, March 02, 2003 9:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Switch Statement || Case with multiple values? Hey all. In Cold Fusion I was able to do the following

Re: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Leif K-Brooks
switch($value){ case 'foo': case 'bar': //It's either foo or bar break; } CF High wrote: Hey all. In Cold Fusion I was able to do the following: CFSWITCH expression = #action# CFCASE value = getUpdate,getDelete Do Stuff /CFCASE /CFSWITCH Note the comma

RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Duh. make that fo will also run the code presented by fum ... -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED] switch($foo) { case fee: case fie: ... break; case fo: ... case fum:

[PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread CF High
Hey all. Don't know if this is possible, but here goes: I've got a simple switch statement that carries out one of several operations based on the switch statement variable value. Each operation has @ 50 lines of html -- do I have to echo or print all this html!? I'm new to PHP so pardon my

RE: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread John W. Holmes
I've got a simple switch statement that carries out one of several operations based on the switch statement variable value. Each operation has @ 50 lines of html -- do I have to echo or print all this html!? You could put your HTML into a separate file and just include() it wherever you

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Johannes Schlueter
On Saturday 25 January 2003 20:38, CF High wrote: Each operation has @ 50 lines of html -- do I have to echo or print all this html!? Try something like ?php switch ($foo) { case 1: ? h1Hello/h1 ?php break; } ? johannes -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Switch statement || How to output html without using echo()or print()

2003-01-25 Thread Leif K-Brooks
No. You can either echo/print with a heredoc (which is still echoing/printing, but is a lot easier) or you can exit PHP. For example: ?php switch($somevar){ case 'case1': print END some html some html some html END; break; case 'case2': print END some html some html some html END; break; } ?

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Noah
PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, January 25, 2003 8:38 AM Subject: Re: [PHP] Switch statement || How to output html without using echo() or print() On Saturday 25 January 2003 20:38, CF High wrote: Each operation has @ 50 lines of html -- do I have to echo or print all

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Noah
: John W. Holmes [EMAIL PROTECTED] To: 'CF High' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, January 25, 2003 8:42 AM Subject: RE: [PHP] Switch statement || How to output html without using echo() or print() I've got a simple switch statement that carries out one of several operations

Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread CF High
Thanks for the informative response, Leif. Looks like you and Johannes are on the same page -- these solutions save a great deal of time. Thanks, --Noah Leif K-Brooks [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... No. You can either echo/print with a heredoc

[PHP] switch statement question

2002-08-13 Thread Alexander Ross
Say i have a variable $string_var = Once upon a time; is there a way to do this: Switch($string_var) { case(contains Once): doSomething(); break; case(contains the end.) doOtherThing(); break; case(contains time) doNothing(); break; default: echo ERROR } Thanks

RE: [PHP] switch statement question

2002-08-13 Thread Jay Blanchard
[snip] Say i have a variable $string_var = Once upon a time; is there a way to do this: Switch($string_var) { case(contains Once): doSomething(); break; case(contains the end.) doOtherThing(); break; case(contains time) doNothing(); break; default: echo ERROR }

Re: [PHP] switch statement question

2002-08-13 Thread DL Neil
Alternatively Alexander, take a look at the string functions eg strstr(), stristr(), and strpos() all of which can be used to make a condition within the case() criteria. Regards, =dn [snip] Say i have a variable $string_var = Once upon a time; is there a way to do this:

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-29 Thread Christian Reiniger
On Sunday 28 October 2001 22:17, Imar de Vries wrote: Hi all, a very frustrating problem. For some reason I am not able to pass on an array between two functions, although I declare it global in both of them. I suspect my use of a switch statement to control the flow of the [...] switch

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-29 Thread Imar de Vries
Christian Reiniger wrote: So you want to share the array across *requests* That doesn't have *anything* to do with global. Have a look at how HTTP works - each request is an isolated execution of a PHP script. it doesn't have any idea of what other pages the user already looked at. To

[PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Imar de Vries
Hi all, a very frustrating problem. For some reason I am not able to pass on an array between two functions, although I declare it global in both of them. I suspect my use of a switch statement to control the flow of the functions is causing some trouble, but I'm not sure. Changing the order in

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Henrik Hudson
Hey- I would think you would need to define $array_test outside in a global environment rather then inside the function since I think/thought it will just stay scoped in there and that global was used to access variables which weren't defined inside a functions scope and make it look

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Imar de Vries
Henrik Hudson wrote: I would think you would need to define $array_test outside in a global environment rather then inside the function since I think/thought it will just stay scoped in there and that global was used to access variables which weren't defined inside a functions scope and

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Henrik Hudson
Well, the switch statement will only run ONE of the functions, never both. The default runs and then you break out of the switch, also: shouldn't default be at the bottom of the switch? or is that just convention? Anyways, there is no way for main() to ever pass anything to test_one(), since

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread DL Neil
, =dn - Original Message - From: Imar de Vries [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 28 October 2001 21:49 Subject: Re: [PHP] switch-statement overrides use of global arrays? Henrik Hudson wrote: I would think you would need to define $array_test outside in a global

Re: [PHP] switch-statement overrides use of global arrays?

2001-10-28 Thread Imar de Vries
Dl Neil wrote: The global array is being defined in the mainline, but not populated. What happens if you set element 0 to some value (to take up some storage space first) and then try the switched function calls? This did not produce the desired result, unfortunately. The array is filled

[PHP] switch statement

2001-02-25 Thread Peter Houchin
Does any one know where there are some tutorials for the switch statement? Peter Houchin Sun Rentals [EMAIL PROTECTED]

Re: [PHP] switch statement

2001-02-25 Thread Jon Rosenberg
February 25, 2001 9:03 PM Subject: [PHP] switch statement Does any one know where there are some tutorials for the switch statement? Peter Houchin Sun Rentals [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: [PHP] switch statement

2001-02-25 Thread David Robley
On Mon, 26 Feb 2001 12:33, Peter Houchin wrote: Does any one know where there are some tutorials for the switch statement? Peter Houchin Sun Rentals [EMAIL PROTECTED] Have a quick look at http://www.php.net/manual/en/control-structures.switch.php which has some user notes which are

RE: [PHP] switch statement

2001-02-25 Thread Peter Houchin
between the 2 cases -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 1:34 PM To: Peter Houchin; PHP MAIL GROUP Subject: Re: [PHP] switch statement On Mon, 26 Feb 2001 12:33, Peter Houchin wrote: Does any one know where there are some

Re: [PHP] switch statement

2001-02-25 Thread David Robley
On Mon, 26 Feb 2001 13:20, Peter Houchin wrote: I'm playing aruond with the switch statement trying to get one to work for $submit I have 2 forms on the one page (only one displays at a time) 1 is for creating a new record in my data base the other is for updating/changing values from the