If you try to access a form variable that hasn't been set, you get an
undefined index. Try checking with something like 
if(isset($_POST['SortBy'])) {
   // do something with 'SortBy'

In any case, you'll get the undefined index warning anytime you try to
read an array index that hasn't been set.


On Mon, 2002-08-19 at 14:49, Shu Chow wrote:
> I'm using the superglobal $_POST array to access URL 
> parameters passed to my page. I was getting undefined 
> constant errors in my error_log file, and found that I 
> needed to quote the variables in the array. 
>   $_POST['SortBy'] etc. Now, it appears that I've just 
> traded the undefined constant errors for undefined index 
> warnings. Everytime a page hits a page with url 
> parameters, it triggers a warning in the error_log file. 
> What's triggering these undefined index errors? I suppose 
> I could lower the logging level in php.ini, but I'd rather 
> code properly than to hide the problem. Thanks!

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to