Notice: Undefined Index:

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Smellydog
    New Member
    • Sep 2009
    • 1

    Notice: Undefined Index:

    I'm having a strange issue with PHP version 5.2.8 running on Windows Vista with Lighttpd. I receive a Notice that says the following:

    Notice</b>: Undefined index: name in <b>E:\LightTPD\ htdocs\go\go\fo rm.php</b> on line <b>160</b>

    Here is the odd part. No matter what I do, no matter how many times I change the script, add lines, remove lines, the notice keeps referencing the same file and line number. Even when I comment out the line, it still references it. I tried stopping and re-starting the server, no luck. There is something odd going on in the code, but it's too complex to list here as it spans many files and method calls.

    The bottom line is, why does the notice keep referencing a line that does not appear to be the issue? Is there a tool I can use to track down the Undefined Index other than the PHP error message that is bogus? Any help would be appreciated.

    Thanks!
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by Smellydog
    I'm having a strange issue with PHP version 5.2.8 running on Windows Vista with Lighttpd. I receive a Notice that says the following:

    Notice</b>: Undefined index: name in <b>E:\LightTPD\ htdocs\go\go\fo rm.php</b> on line <b>160</b>

    Here is the odd part. No matter what I do, no matter how many times I change the script, add lines, remove lines, the notice keeps referencing the same file and line number. Even when I comment out the line, it still references it. I tried stopping and re-starting the server, no luck. There is something odd going on in the code, but it's too complex to list here as it spans many files and method calls.

    The bottom line is, why does the notice keep referencing a line that does not appear to be the issue? Is there a tool I can use to track down the Undefined Index other than the PHP error message that is bogus? Any help would be appreciated.

    Thanks!
    No idea, but we'd have a better chance of helping you if we could see the file in question.

    Mark.

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      Undefined array means you have an array which doesn't have the said index.

      eg. If you have an array arr = array("1" => "xyz", "2"=>"abc") and you try for getting value of arr[0], it will give you undefined index error.

      Comment

      Working...