Page 1 of 1

how do i check if a texfield is really empty

Posted: Thu Jun 08, 2006 4:01 am
by pedrotuga
Ok...

i am using $_GET ( yes, in this case i really have to use get, i know post is more secure and stuff ) and i want to use something like

Code: Select all

if (isset($_GET["variable_from_text_field"])){
...
}
the problem is: the form allways sends that field variable even if its empty... how can i check if its empty? btw, only spaces shouldnt pass the if test either.

Re: how do i check if a texfield is really empty

Posted: Thu Jun 08, 2006 4:04 am
by aerodromoi
pedrotuga wrote:Ok...

i am using $_GET ( yes, in this case i really have to use get, i know post is more secure and stuff ) and i want to use something like

Code: Select all

if (isset($_GET["variable_from_text_field"])){
...
}
the problem is: the form allways sends that field variable even if its empty... how can i check if its empty? btw, only spaces shouldnt pass the if test either.
Try using empty();

aerodromoi

Posted: Thu Jun 08, 2006 4:16 am
by pedrotuga
working

thanks

Posted: Thu Jun 08, 2006 5:13 am
by s.dot
also combine trim() with empty