Undefined Index?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Undefined Index?

Post by Jim »

Hey folks.

Just quick questions. When I set error reporting to E_ALL, I get the "Undefined Index" error when I use the following:

Code: Select all

$action = $_GET['action']; 

if ($action == 'dothis') { 
// Do this stuff 
}





The url does indeed have the 'action' variable defined as I asked it to. What does that mean, and how can I fix it?
cirox
Forum Newbie
Posts: 4
Joined: Fri May 16, 2003 4:11 pm

Post by cirox »

I dont see anything wrong, but you might try renaming the variable.. Action is one of those words that seems like it would be too easy for either the browser or the server to intercept as being default HTTP protocol/HTML language (such as in the form tag.. >form action="bleh" method="get"<, or the http ACTION) so, that's all I know to tell you.
Post Reply