Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 16
    possible duplicate of Reference - What does this error mean in PHP? Commented Oct 8, 2013 at 15:25
  • 4
    the variable might not have been initialized. Are you initializing the variable from a post or get or any array? If that's the case you might not have an field in that array. That your accessing. Commented Dec 15, 2015 at 13:12
  • 4
    @Pekka웃 - I noticed the edit adding the "and "Notice: Undefined offset"" - Wouldn't it make more sense using "PHP: “Undefined variable”, “Undefined index”, “Undefined offset” notices" (even take out the PHP, since it is tagged as "php". Plus, the URL gets cut off at and-notice-undef, just a suggestion so that the URL doesn't get cut off. Maybe even removing the (too many) quotes. Or PHP: “Undefined variable/index/offset” notices Commented Jan 20, 2017 at 15:24
  • 4
    @Fred I guess an argument can be made for both variations. THere's a chance that newbies will enter the entire line, including the "Notice:" into their search query, which I'm sure is the main traffic generator for this question. If the messages are there in full, that's likely to improve visibility in search engines Commented Jan 20, 2017 at 15:34
  • 3
    @Pekka웃 I understand. I only said that because the URL didn't get cut off before and now it does at and-notice-undef. It was just a (few) suggestion(s). It just repeats itself also being Notice: Undefined. Commented Jan 20, 2017 at 15:35