Who am I where amI Why am I here..............

I tries installing PHP on my windows 2000server and got this:

Notice: Undefined index: code in C:domainhosting-470index.php on line 6

Notice: Constant opendomains already defined in C:domainhosting-470includeconfig.php on line 2

Notice: Use of undefined constant mysql - assumed ‘mysql’ in C:domainhosting-470includeconfig.php on line 4

What does this imply? How can I fix this?



The messages should be quite clear:

Notice: Undefined index: code in C:domainhosting-470index.php on line 6 

Notice means the script won’t break, but unexpected behaviour may occur.
Undefined index: code means that you are calling an element in an array somewhere that has not been instantiated, or at least not given a value.
in [path_to_page] on line 6 gives you a hint of where to find the problem.

Open up your index.php (in this case) and find the code on line 6. See if the outlined problem really does occur there.

You should be able to figure out the other two by yourself with this explanation :slight_smile:

Generally speaking one error can and often is the cause of subsequent errors.

For example if you got an error for an undefined index , as Zyppora points out, there is an array that is not initialized with data at a particular index. Not (necessarily) a show stopper. However, if that “array” was to contain the name of a file that you need to include, then you may get a subsequent error stating that the file couldn’t be open.

For this fact, you should generally correct the first error (and any other obvious errors you encounter) and then re-run. The errors may change dramatically (or not), or many errors may go away (as they may have been dependant on the first item that errored).

Slight correction: include() gives a warning, and require() throws an error ;)

Sponsor our Newsletter | Privacy Policy | Terms of Service