Multiple Checkboxes Error
I'm new to PHP, but have been reading the message boards, so I'm a bit familiar with what's going on. However, I am having a problem with something that is probably really simple to fix.
I've created a form with multiple checkboxes (total of 3). If all the boxes are selected, there's NO problem. Now, if I were to choose only 2 checkboxes and leave the third blank and submit the form I get the following error:
Notice: Unidefined index: choice3 in C:\Inetpub\ftproot\development\php_testing\chapter 3\multipleChecks.php on line 11
Now I now the other to choices are passed because their values are displayed.
The weird thing is that I have also tried this example on my Mac, and it does exactly what it's supposed to do... display the values of the checkboxes that were selected and not display anything if not selected. My other box is a PC running Windows 2000 Pro.
Before I forget... I have used $_GET['variableName'] to retreave the values passed to my php page, so I know it's not that.
EXACT CODE USED minus HTML tags:
<?php
echo $_GET['choice1'];
echo $_GET['choice2'];
echo $_GET['choice3'];
?>
Any ideas why I'm getting this error when I know I shouldn't be getting it?
|