Or, you can simply just allow errors, and then learn to fix them. That way your programs will work as they should, and you will get better.It basically get's rid off all errors on your page.
Make sure you put them in PHP tags at the top of your page
PHP:error_reporting (E_ALL ^ E_NOTICE); // Gets rid off all errors
Hope I helped
UhmIt basically get's rid off all errors on your page.
Make sure you put them in PHP tags at the top of your page
PHP:error_reporting (E_ALL ^ E_NOTICE); // Gets rid off all errors
Hope I helped
error_reporting (0); // Gets rid off ALL errors
@garettjoey's method is better, however, I prefer to have the errors enabled and display all of them so if an error does occur then I will know what line it is on and what is wrong with it.
In the past I've often disabled error reporting and something never worked and I had forgotten that I had disabled error reporting which made me very angry because I didn't know what was wrong with my project.
<?php
switch($_PAGE['id'])
{
case 'index':
print '';
break;
case 'home':
print '';
break;
}
<?php
if(!isset($_GET['page'])) ? $_GET['page'] : 'index';
switch($_PAGE['id'])
{
case 'index':
print '';
break;
case 'home':
print '';
break;
}
?>
Sorry to be an asshole and possibly spam the thread, but would you really get an error for $_PAGE? Wouldn't it just recognise it as an undefined array and not pass off an error, just run through the code anyway?M0nsta is right or DuckilingXError reporting was made to help the developer figure out what was wrong in the code. In all if you don't want any errors, just fix it to a point were it doesn't need error reporting..
example ( ik code is shit i just wook up! )
You will Get the PHP error undefined $_PAGE i believePHP:<?php switch($_PAGE['id']) { case 'index': print ''; break; case 'home': print ''; break; }
i believe to fix this with out error_reporting
PHP:<?php if(!isset($_GET['page'])) ? $_GET['page'] : 'index'; switch($_PAGE['id']) { case 'index': print ''; break; case 'home': print ''; break; } ?>
P.S. if this makes no sence just ignore it ;P imma magical sleepy poster@!!
Nope php would give you <b>message</b> important or undefined there if there was no error_reporting tag i think actually you cant do _GET with out error reporting unless u use if statements
echo $_POST['param'];