Re: undefined variable: action
| From: | Ryan M | Date: | Wed, 11 Jun 2003 19:22:16 +0000 |
| Subject: | Re: undefined variable: action | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151116@lists.php.net to get a copy of this message | ||
Thanks for the advice... The link worked.... Now it is saying this:
Notice: Undefined index: action in....
It only says this if there is no action...it goes away once I click the link
and the action=someaction.... Is there a way to fix my php so that I dont
have to change all of the web sites hosted on my server?? Thanks!
Ryan
"Jay Blanchard" <jay.blanchard@niicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B0101F7D6@nemesis...
[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