I recently changed pcs and transferred a site I was working on from one pc to the other (including database).
When loading my site in the new pc, I encounter this error:
Notice: Use of undefined constant
Notice: Undefined index:
I did some research and found it can be solved by adding this to my code:
<?php error_reporting (E_ALL ^ E_NOTICE); ?>
Is this something good to do? Or should I change my code more?
It is most likely different PHP settings. The computer you are now testing on has notices turned on. In your php.ini file search for the text “error_reporting” and change it to
E_ALL & ~E_NOTICEif you don’t want to see notices.But it is best to keep notices on in your development environment
EDIT:
I see you edited your original question with the answer