Nickster Posted April 3, 2006 Share Posted April 3, 2006 Ok so I have been getting errors in my log files and most of them seem PHP related and I was wondering if you guys could help.Here's the error:[client **.**.*.**] PHP Notice: Use of undefined constant MSG_ADD - assumed 'MSG_ADD' in /var/www/ASG/lib/messages.php on line 5And here is the way MSG_ADD is defined in messages.phpdefine(MSG_ADD,'Record Added Successfully.');I was wondering if I change the code to this:define('MSG_ADD','Record Added Successfully.');would that correct the errors? Their are about 150 times that Define is used in messages.php and I want to be sure that, that solution would correct the problem before I go in and change things around? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/6519-php-errors-and-a-possible-solution/ Share on other sites More sharing options...
ToonMariner Posted April 3, 2006 Share Posted April 3, 2006 Yes. That will solve your problems. Quote Link to comment https://forums.phpfreaks.com/topic/6519-php-errors-and-a-possible-solution/#findComment-23632 Share on other sites More sharing options...
wildteen88 Posted April 4, 2006 Share Posted April 4, 2006 Notices are not errors. Errors stop your script from running how notices allow your script to continue. PHP notices are just telling you that something isn't correct however PHP was smart enaough to correct the issue as it assumed you meant 'var' instead of var.$_GET[var]PHP thinks you're are using a constant called var and not the index or key called var. This is why you should use quotes when you are using keys in an arrray or defining a variabled etc.So if you use:define('MSG_ADD','Record Added Successfully.');You shouldn't get any notice messages by doing the above. Quote Link to comment https://forums.phpfreaks.com/topic/6519-php-errors-and-a-possible-solution/#findComment-23787 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.