Undefined index
| From: | caspar kennerdale | Date: | Wed, 07 May 2003 15:37:02 +0000 |
| Subject: | Undefined index | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146693@lists.php.net to get a copy of this message | ||
I have a basic switch defining the structure of my page. (see below)
Whenever the default case is loaded I get a message that "action" is an
undefined index. I understand that this is because "action" has no value. If
I go to any of the other cases of my switch and thus giving "action" a value
then I do not get the message.
How do I give action an initial value so this message does not appear
initally? (I dont want to rely on isps turing messaging off!)
If this isnt possible can you turn messaging off in .htaccess in the same
way you can control register globals?
<?php
switch ($_GET['action']) {
default:
echo "<a href=\"index.php?action=Test&variable=yes\">test</a>";
break;
case "Test":
$variable=$_GET["variable"];
echo $variable;
break;
}
?>