Page 1 of 1

$_GET

Posted: Sat May 16, 2009 12:44 pm
by kemaltuna
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.

Re: $_GET

Posted: Sat May 16, 2009 12:52 pm
by ldougherty
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:

Code: Select all

 
if (!isset($_POST['action']))
{
//If not isset -> set with dumy value
$_POST['action'] = "undefine";
}
 
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:

Code: Select all

<?php error_reporting (E_ALL ^ E_NOTICE); ?>