$_GET

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kemaltuna
Forum Newbie
Posts: 1
Joined: Sat May 16, 2009 12:28 pm

$_GET

Post 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.
ldougherty
Forum Contributor
Posts: 103
Joined: Sun May 03, 2009 11:39 am

Re: $_GET

Post 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); ?>
Last edited by Benjamin on Sat May 16, 2009 1:07 pm, edited 1 time in total.
Reason: Added [code=php] tags.
Post Reply