Welcome Guest, Not a member yet? Register   Sign In
May I hide Undefined index error?
#1

[eluser]Wilianto Indrawan[/eluser]
hello guys, i need your help.

May I hide "Undefined index" error from my browser?
maybe there is a configuration to set up it.

thank you.
#2

[eluser]vrencianz[/eluser]
See http://ellislab.com/codeigniter/user-gui...rrors.html

Quote:Note: By default, CodeIgniter displays all PHP errors. You might wish to change this behavior once your development is complete. You'll find the error_reporting() function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files from being written if there are errors.
#3

[eluser]CroNiX[/eluser]
[quote author="Wilianto Indrawan" date="1336719763"]hello guys, i need your help.

May I hide "Undefined index" error from my browser?
maybe there is a configuration to set up it.

thank you.[/quote]
It would be much better to use better programming practices and see if it exists before trying to use it instead of hiding your errors or warnings. They're trying to tell you something. Fix the problems instead of hiding them.
Code:
if (isset($some_array['key']))
{
  //Do your stuff
}
#4

[eluser]vrencianz[/eluser]
Yep. Few guys I knew had no problem with that. ... and they insisted to work in that way Smile.

Of course, eliminating all errors/warnings/notices is the recommended practice instead of hiding them.
#5

[eluser]Wilianto Indrawan[/eluser]
okay, thank you guys for you advice. Smile




Theme © iAndrew 2016 - Forum software by © MyBB