Page 1 of 1
Undefined index: login_user in D:\wamp\www\index.php on line
Posted: Tue Nov 29, 2011 6:15 am
by shaunak1234
I use login_user to validate login and display username!
I changed my server from ubuntu to windows,
Now I have this problem
Undefined index: login_user in D:\wamp\www\index.php
I know it is because my login_user is null at the index page!
Just how do i switch this warning off?
Re: Undefined index: login_user in D:\wamp\www\index.php on
Posted: Tue Nov 29, 2011 6:22 am
by social_experiment
Re: Undefined index: login_user in D:\wamp\www\index.php on
Posted: Tue Nov 29, 2011 6:26 am
by shaunak1234
Actually I fixed it my self
In php.ini find “ error_reporting = E_ALL”
Here replace this with “error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING “
Thats it!
may this post help others
Re: Undefined index: login_user in D:\wamp\www\index.php on
Posted: Tue Nov 29, 2011 7:24 am
by maxx99
You should check if that index exists with isset or empty instead of turning off error_reporting

Re: Undefined index: login_user in D:\wamp\www\index.php on
Posted: Tue Nov 29, 2011 7:32 am
by social_experiment
maxx99 makes a good point; the OP doesn't mention about any checking (which they might be doing) but if not it's a better option to do checking instead of hiding the error. For production it's better to see an error and take care of it. For live site purposes, it's better to hide the errors (if you have taken care of them) because you don't want visitors seeing the errors