RE: [PHP] Trouble with switch statements
| From: | Thoenen, Peter Mr. EPS | Date: | Sun, 27 Oct 2002 05:53:02 +0000 |
| Subject: | RE: [PHP] Trouble with switch statements | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121579@lists.php.net to get a copy of this message | ||
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: php-general@lists.php.net
> 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
>