Undefined Index - is this how you "declare" get & post?
| From: | Terence | Date: | Thu, 30 Oct 2003 00:40:24 +0000 |
| Subject: | Undefined Index - is this how you "declare" get & post? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-168092@lists.php.net to get a copy of this message | ||
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.