Page 1 of 1

undefined index

Posted: Thu May 01, 2003 7:47 am
by jagsdj
Cannot seem to figure out this error...
could somebody please explain it...

<Notice:undefined index: Color in g:\\path\fulename.php on line 3>

all help is greatly appreciated!

jag

Posted: Thu May 01, 2003 7:54 am
by []InTeR[]
Can you post your script?

The error has something to do with array's.

But it's a Notice, if you set your error_reports to:
error_reporting (E_ERROR | E_WARNING | E_PARSE);

You won't have any trouble again.

undefined index

Posted: Thu May 01, 2003 8:11 am
by jagsdj
here's the line where the error is occuring:

if($HTTP_COOKIE_VARS["Color"]=="be1f13"){$admin=true;} // Logged in as Admin.


thanks again

Posted: Thu May 01, 2003 8:18 am
by []InTeR[]
Do you check if even the cookie is set?

Code: Select all

if(isset($HTTP_COOKIE_VARS&#1111;"Color"]))&#123;
  if($HTTP_COOKIE_VARS&#1111;"Color"]=="be1f13")&#123;$admin=true;&#125; // Logged in as Admin.
&#125;

undefined index

Posted: Thu May 01, 2003 8:38 am
by jagsdj
Jason

I inherited this proj from another consultant, so please forgive me if my questions are responses are kinda slow...

okay, i thin the cookie is set by the following code:

if(@file_exists($level2)){
setcookie ("Color", "be1f13");
}elseif(@file_exists($level1)){
setcookie ("Color", "f1f2f2");
}else{
setcookie ("Color", "ffffff");
}

$level1 and $level2 are different paths to different filnames.