RE: [PHP] Trouble with switch statements

2002-10-27 Thread Gareth Hastings
Edward,

Try

   Case "1":
 .
   Break;

-Original Message-
From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca] 
Sent: Friday, October 25, 2002 6:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble with switch statements

Ok...I just recently installed Apache1 and PHP 4.2.3 on my computer and
I've
configured everything. However, I can't seem to get my switch statements
to
accept variable values from the address bar. So if I type in:

http://www.my-site.com/index.php?select=1

It displays the text in the default part of the switch statement. I also
seem to get the following error message every time:

Notice: Undefined variable: select in c:\apache\apache\htdocs\index.php
on
line 51

Here's the code for my switch statement as well:

switch($select)
{
 case 1: print "About Stuff Goes Here.";
   break;
 case 2: print "Music Goes Here.";
   break;
 default:print "Testing...";
   break;
}




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Trouble with switch statements

2002-10-27 Thread @ Edwin
Hello,

"eNetwizard Developers Team" <[EMAIL PROTECTED]> wrote:

> 
> Use $_GET["select"] for the switch statement
> 
> Some of the people on this list would even recommend you make another
> variable first, such as $userselect = $_GET["select"] and use
> $userselect as your switch statement, though I think it pointless.

Perhaps, in a simple switch($_GET["select"]) statement. But there are 
times that it makes more sense to assign a $_GET[''] or $_POST[''] to 
another variable ;)

- E

...[snip]...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Trouble with switch statements

2002-10-26 Thread eNetwizard Developers Team

Use $_GET["select"] for the switch statement

Some of the people on this list would even recommend you make another
variable first, such as $userselect = $_GET["select"] and use
$userselect as your switch statement, though I think it pointless.

Or turn register_globals on in the php.ini file (not recommended)

-Samuel | http://enetwizard.net



-Original Message-
From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca] 
Sent: Friday, October 25, 2002 1:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble with switch statements

Ok...I just recently installed Apache1 and PHP 4.2.3 on my computer and
I've
configured everything. However, I can't seem to get my switch statements
to
accept variable values from the address bar. So if I type in:

http://www.my-site.com/index.php?select=1

It displays the text in the default part of the switch statement. I also
seem to get the following error message every time:

Notice: Undefined variable: select in c:\apache\apache\htdocs\index.php
on
line 51

Here's the code for my switch statement as well:

switch($select)
{
 case 1: print "About Stuff Goes Here.";
   break;
 case 2: print "Music Goes Here.";
   break;
 default:print "Testing...";
   break;
}




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Trouble with switch statements

2002-10-26 Thread Thoenen, Peter Mr. EPS
switch($_GET['select']){
case 1:

..

-Peter

> -Original Message-
> From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca]
> Sent: Friday, October 25, 2002 19:47
> To: [EMAIL PROTECTED]
> Subject: [PHP] Trouble with switch statements
> 
> 
> Ok...I just recently installed Apache1 and PHP 4.2.3 on my 
> computer and I've
> configured everything. However, I can't seem to get my switch 
> statements to
> accept variable values from the address bar. So if I type in:
> 
> http://www.my-site.com/index.php?select=1
> 
> It displays the text in the default part of the switch 
> statement. I also
> seem to get the following error message every time:
> 
> Notice: Undefined variable: select in 
> c:\apache\apache\htdocs\index.php on
> line 51
> 
> Here's the code for my switch statement as well:
> 
> switch($select)
> {
>  case 1: print "About Stuff Goes Here.";
>break;
>  case 2: print "Music Goes Here.";
>break;
>  default:print "Testing...";
>break;
> }
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php