Jump to content

Recommended Posts

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???

Link to comment
https://forums.phpfreaks.com/topic/140258-display_errors/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-733928
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-733937
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-734214
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/140258-display_errors/#findComment-734493
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.