0

how can i fix use of undefined constant in php.ini

so that constant and "constant" should not gives me any error

3
Contributors
6
Replies
8
Views
8 Years
Discussion Span
Last Post by Atli
0

how can i fix use of undefined constant in php.ini

so that constant and "constant" should not gives me any error

nothing is clear with this, exactly what you want to do

0

i am trying to develop a site.............when i referesh page it gives me the follwoing error
Use of undefined constant admin_mail - assumed 'admin_mail'

i am hosting my site on my home server so i want to set my php.ini so that i didn't get the above error

2

i am trying to develop a site.............when i referesh page it gives me the follwoing error
Use of undefined constant admin_mail - assumed 'admin_mail'

i am hosting my site on my home server so i want to set my php.ini so that i didn't get the above error

It may be the case that you unknowingly deleted the '$' in front of the variable 'admin_mail'.
search for it in your script

1

Hey.

Yea, you typically get this warning if you leave out the $, as network18 suggested, or when you forget the quotes around a string.
In either case, PHP will assume it is a string who's quotes got left out and use it as such.

Ideally you should hunt the bug down and fix it, but if for some reason you just want to hide it, you can add this to the top of your page:

ini_set('display_errors', false);
error_reporting(0);

Or you can hunt down either of those directives in your php.ini file and set them there. (Note, that will affect all PHP scripts on your server!)

0

hey Atli, thanks for carrying forward the idea.
But personally i recommend of clearing this type of syntactical errors at the very moment and disagree with turning the error reporting off, because I feel at the learning stage the person should learn to deal with all such types of errors and warning message .
Going one step ahead, i recommend not to avoid the warnings also.

-1

hey Atli, thanks for carrying forward the idea.
But personally i recommend of clearing this type of syntactical errors at the very moment and disagree with turning the error reporting off, because I feel at the learning stage the person should learn to deal with all such types of errors and warning message .
Going one step ahead, i recommend not to avoid the warnings also.

Agreed. Like I say, ideally these sort of bugs should be hunted down and fixed, even though the code may function without it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.