Re: Undefined Index - is this how you "declare" get & post?

From: Jon Kriek (kriek_at_phpfreaks.com)
Date: 10/30/03


To: php-general@lists.php.net
Date: Wed, 29 Oct 2003 19:44:41 -0500

settype(), isset(), and empty() checks will all bypass this, but there is no
need to have error reporting set that high ...

error_reporting(2047);

-- 
Jon Kriek
http://phpfreaks.com
"Terence" <terence@sunway.edu.my> wrote in message
news:029901c39e7e$684c3ac0$c90010ac@terence...
> Hi List,
>
> Since I started using error_reporting(E_ALL), I havent found (in my
opinion)
> a good way to declare GET and POST variables when getting them from a form
> or querystring. I have searched google and the docs for several hours now
> without much luck.
>
> <?php
> error_reporting(E_ALL);
> // This line stops the error reporting, else I get - Notice: Undefined
> index: i in.....
> $HTTP_GET_VARS["i"]="";
>
> if ($HTTP_GET_VARS["i"] == "") {
>  include("myfile.php");
> }
> ?>
>
> Is there a better way?
> I have tried var $i (only for classes I've discovered)
> settype($i, "integer")
>
> Thanks in advance.