Hello, recently a friend of mine had moved all his PHP sites to a new server, but there was a problem with one. When this particular site was made the guy did not use quotes within the keys and apparently the new server or PHP does not play nice with that.

Example:
$Something[form_styles]
Notice: Use of undefined constant form_styles - assumed 'form_styles' in /home/wefinanc/public_html/list on line 20

I was curious if there was something in php.ini that he could set to resolve this instead of going through all the code by hand and putting quotes on the keys. Thanks!

    Nevermind I answered my own question. I had him turn off notices within the error reporting in the php.ini and the errors went away.

      magnav0x wrote:

      I was curious if there was something in php.ini that he could set to resolve this instead of going through all the code by hand and putting quotes on the keys.

      The error reporting level could be set to ignore that warning, but ultimately it is a problem with the code so he should change the code to enclose the keys in quotes when the keys are string literals. (Obviously, he should not enclose them in quotes if they really are defined constants, and enclosing variables in quotes is optional.)

        Write a Reply...