RE: Can't do anything with variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > The problem. Even if I fill both fields, I always get "Notice:
Undefined
> variable: searchtype"
> >
> </snip>
> 
> My guess is that you are using a windows platform ?  The windows
version
> of PHP doesn't like variable testing syntax like:-
> 
> if ($testvar) { echo "hallo"; }  // You can get away with this on
*nix.
> 
> It insists that you use:-
> 
> if (isset($testvar)) { echo "hallo"; }

Ummm, that has nothing to do with windows. It will work on any platform,
but may give a WARNING depending on your error_reporting() level. But
yes, it is a good idea to use isset(), regardless. Remember that
textboxes will always be set, even if nothing was typed in. Only buttons
and checkboxes can really come across "not set". 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux