You are here: Re: Undefined Index notices « PHP Programming Language « IT news, forums, messages
Re: Undefined Index notices

Posted by Bent Stigsen on 06/09/06 19:05

Craig Morrison wrote:

> Bent Stigsen wrote:
>> Craig Morrison wrote:
>>
>>> Markus Ernst wrote:
>>>> Craig Morrison schrieb:
>>>>> I'm getting this:
>> [snip]
>>>>> My question is why?
>>>>>
>>>>> I *am* getting the correct value for $_POST['D1'] and at this point in
>>>>> time am really quite confused because that notice is getting thrown.
>>>> Have you checked this, i.e. with print_r($_POST) or var_dump($_POST)?
>>>> In such cases I usually try this first; if $_POST['D1'] is set at the
>>>> top of the script you might find out where it gets lost.
>>> The question is, if it's invalid how come I am getting the correct value
>>> that is POSTed to the script?
>>
>> That's a pretty moot question, unless you think magic is causing it.
>>
>> Consider it a flaw/bug in your construction. Markus' suggestion might get
>> you some insight into what might be the problem.
>>
>> /Bent
>
> How is it moot?

Well, I can't see how PHP would get the value, if the index was invalid or
non-existing.

> A form posts the value for D1 to a script, script looks for the value of
> D1 and gets it. PHP raises a notice that D1 is undefined.
>
> I don't understand how I am getting the value that is posted to the
> script if the index is undefined.
>
> Is it really that difficult for someone to explain this?

Yes, because in all likelyhood, that is not what is happening.

Arrays and forms are so commonly used that, if it was a bug then it would be
reported all over the place.


/Bent

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация