RE: [PHP] undefined variable: action
| From: | Jay Blanchard | Date: | Wed, 11 Jun 2003 19:12:30 +0000 |
| Subject: | RE: [PHP] undefined variable: action | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151115@lists.php.net to get a copy of this message | ||
[snip]
Hows it goin?? Im pretty new to this, so I have a pretty simple
question. I am running an apache server with php 4 on a win 2k machine.
When I try to do something like this: <?
echo "<a href=\"index.php?action=someaction\">Some Action</a>";
if ($action == "someaction") {
echo "Anything";
}
?>
It says: Notice: Undefined variable: action in .....
Ive built plenny of pages with simple things like that, and they all
work...is it a problem with my apache server??? Thanks in advance
[/snip]
You probably updated PHP recently and register_globals is now 'off'. Try
if($_GET['action'] == "someaction"){
do foo
}
HTH!
Jay