vividona Posted January 10, 2009 Share Posted January 10, 2009 Hi friends, I have simple funny scripts. It works fine. but when I made update to my wamp server apache, it gave me so many error. like: Notice: Undefined variable: UserId in D:\wamp\www\bhl\classes\BHL_login.php on line 24 Notice: Undefined index: first_name in D:\wamp\www\bhl\classes\BHL_login.php on line 24 Notice: Undefined index: family_name in D:\wamp\www\bhl\classes\BHL_login.php on line 24 Notice: Undefined index: new_user in D:\wamp\www\bhl\classes\BHL_login.php on line 24 Notice: Undefined index: password in D:\wamp\www\bhl\classes\BHL_login.php on line 24 Notice: Undefined index: verpass in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined index: emailadd in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: UserIpAdd in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: Date in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: Uregcode in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: Host in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: Self in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: Smail in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: Time in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: URL in D:\wamp\www\bhl\classes\BHL_login.php on line 25 Notice: Undefined variable: REFERRER in D:\wamp\www\bhl\classes\BHL_login.php on line 26 Notice: Undefined variable: StartSession in D:\wamp\www\bhl\classes\BHL_login.php on line 26 Notice: Undefined index: subject in D:\wamp\www\bhl\classes\BHL_login.php on line 26 Notice: Undefined index: content in D:\wamp\www\bhl\classes\BHL_login.php on line 26 Notice: Undefined index: comment in D:\wamp\www\bhl\classes\BHL_login.php on line 26 Notice: Undefined variable: ScptName in D:\wamp\www\bhl\classes\BHL_login.php on line 26 Notice: Undefined variable: ScptEm in D:\wamp\www\bhl\classes\BHL_login.php on line 27 Notice: Undefined index: cat in D:\wamp\www\bhl\classes\BHL_login.php on line 27 Notice: Undefined index: catDesc in D:\wamp\www\bhl\classes\BHL_login.php on line 27 Notice: Undefined index: subcat in D:\wamp\www\bhl\classes\BHL_login.php on line 27 Notice: Undefined index: SubcatDesc in D:\wamp\www\bhl\classes\BHL_login.php on line 27 Notice: Undefined variable: BHL_HOST in D:\wamp\www\bhl\BHL_DB.php on line 28 Notice: Undefined variable: BHL_USER in D:\wamp\www\bhl\BHL_DB.php on line 29 Notice: Undefined variable: BHL_PASS in D:\wamp\www\bhl\BHL_DB.php on line 30 Notice: Undefined variable: BHL_NAME in D:\wamp\www\bhl\BHL_DB.php on line 31 but my script works so fine. I disabled display_errors from wamp apache php setting. all errors disapeared. my question is: is there realy risk in my script because of these errors??? Quote Link to comment https://forums.phpfreaks.com/topic/140258-display_errors/ Share on other sites More sharing options...
xtopolis Posted January 10, 2009 Share Posted January 10, 2009 Yes. Undefined variable: tried to access a variable that didn't exist Undefined index: tried to access an array element that didn't exist [out of bounds] Just because the script still works, doesn't mean it's all ok. You could probably fix most of those errors easy by going to those lines and looking at it. Quote Link to comment https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-733928 Share on other sites More sharing options...
vividona Posted January 10, 2009 Author Share Posted January 10, 2009 Yes. Undefined variable: tried to access a variable that didn't exist Undefined index: tried to access an array element that didn't exist [out of bounds] Just because the script still works, doesn't mean it's all ok. You could probably fix most of those errors easy by going to those lines and looking at it. thank you xtopolis for your explanation but I defined those variables in other class, then I extended the class to new one. now all varibales are working but these errors will get me mad Quote Link to comment https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-733937 Share on other sites More sharing options...
wildteen88 Posted January 10, 2009 Share Posted January 10, 2009 You must be doing something wrong. PHP does not display errors for no reason. You should always enable display_errors and ensure error_reporting is set to E_ALL whilst developing/testing your PHP scripts. The errors you have posted are easily fixed though. Quote Link to comment https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-734214 Share on other sites More sharing options...
Rushyo Posted January 10, 2009 Share Posted January 10, 2009 The reason for these notices (the 'weakest' form of error) is that when combined with register_globals they pose a significant security threat. That coding style is also the cause of many coding mistakes. Quote Link to comment https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-734327 Share on other sites More sharing options...
Mchl Posted January 11, 2009 Share Posted January 11, 2009 Luckily register_globals is disabled by default in WampServer and will soon be the thing of the past. Personally, when programming for myself, I couldn't care less for undefined variables. Sue me! I just take good care of my variables. To disable notices and still display all other errors use error_reporting(E_ALL ^ E_NOTICE); You can also set default reporting level in php.ini. Just consider what you've been told here by others before disabling those. Quote Link to comment https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-734493 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.