I'm trying to learn php coding via installing ready GNU scripts.
I allways get the following error because of $_GET and $_REQUEST :
Notice: Undefined index: buildall in D:\wamp\www\gallery\gg1\index.php on line 839
and the line 839 is : if(is_numeric($_GET["buildall"]))
As far as I understand it's because the variable used with these two codes are not defined, but I don't know how to solve it.
Please somebody help me.
$_GET
Moderator: General Moderators
-
ldougherty
- Forum Contributor
- Posts: 103
- Joined: Sun May 03, 2009 11:39 am
Re: $_GET
There are no reason to pay attention to NOTICES, they are just informational.
- - - -
http://www.dmxzone.com/go?13811
This error appears because of your PHP error reporting settings. Usually, it appears when your variable is not properly set. There are two ways to handle this issue:
1. Check if $_POST['action'] is set before using it. For example:
2. Suppress Notice warnings
Notice warnings could be suppressed by changing the error_reporting variable in your PHP.ini. error_reporting could be set to show all errors except those for notices and coding standards warnings: error_reporting = E_ALL & ~E_NOTICE
The same is accomplished by adding the following line in your php page:
- - - -
http://www.dmxzone.com/go?13811
This error appears because of your PHP error reporting settings. Usually, it appears when your variable is not properly set. There are two ways to handle this issue:
1. Check if $_POST['action'] is set before using it. For example:
Code: Select all
if (!isset($_POST['action']))
{
//If not isset -> set with dumy value
$_POST['action'] = "undefine";
}
Notice warnings could be suppressed by changing the error_reporting variable in your PHP.ini. error_reporting could be set to show all errors except those for notices and coding standards warnings: error_reporting = E_ALL & ~E_NOTICE
The same is accomplished by adding the following line in your php page:
Code: Select all
<?php error_reporting (E_ALL ^ E_NOTICE); ?>
Last edited by Benjamin on Sat May 16, 2009 1:07 pm, edited 1 time in total.
Reason: Added [code=php] tags.
Reason: Added [code=php] tags.