In article <me********************************@free.fr.Remove this>,
Jedi121 <je*********@free.fr.Removethis> wrote:
if($http_post_vars['name']){do this}
I prefer using isset() function : http://www.php.net/isset
I have a similar issue as the first poster.
isset($_POST['name']) works, as does if ($_POST['name']!=NULL) . The
problem is that, if error_reporting is set to E_ALL, both of those will
pop up an error that says "Notice: Undefined index: name" at the top of
the page. Yes, you can make that go away by setting error_reporting to
ignore Notices, but when I'm testing scripts I like to keep it on E_ALL
so I know if I'm doing something that's not fatal but still stupid.
So is there a way to check for a variable's existence without PHP
whining if it doesn't exist? :P
if ($POST['name']) seems to always evaluate as true in my tests -- as
well as pop up a Notice.