Richard Kurth wrote:
> What do you do when isset does not work? If I send data in a
> $_REQUEST['var'] like 
> if (isset($_REQUEST['var'])) {
> }
> Put var has no data it still says it is set. Because $_REQUEST['var'] = ""
> and isset thinks "" is set

php -r ' $r = array("foo" => ""); var_dump(isset($r["foo"]),empty($r["foo"]));'

so empty() should give you the result your looking for  ...
some tips:

1. generally use $_GET or $_POST in preference to $_REQUEST
2. be specific about your input validation, e.g.:

if (isset($_GET['var']) && ($_GET['var'] == 'foo')) {
        echo "got it!";
}

> 

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

Reply via email to