Re: Undefined index error

From: Date: Sun, 10 Jun 2007 23:41:59 +0000
Subject: Re: Undefined index error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-256577@lists.php.net to get a copy of this message
On Sat, June 9, 2007 11:53 pm, Christian Cantrell wrote: > I'm getting this error in my Apache log file, and I can't figure out > why: > > Undefined index: password in /path/to/file.php on line 82 > > Some searching on Google turned up a bunch of questions, but no > answers. > Any idea what this warning message is referring to? If you use something like: $_POST['password'] $_COOKIE['password'] // this is a REALLY Bad Idea $_GET['password'] //bad idea $_SESSION['password'] . . . but you don't actually *HAVE* a 'password' in the array, then you will get that error message. Your assumption that you have some kind of password is invalid. Check first: if (isset($whatever['password'])){ //rest of your code in here. } -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#256577) next »