Re: checking for empty array from a form field? grrrrrrrrrrr!
| From: | Mark | Date: | Wed, 05 Feb 2003 21:07:08 +0000 |
| Subject: | Re: checking for empty array from a form field? grrrrrrrrrrr! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25463@lists.php.net to get a copy of this message | ||
First try isset($product) to see if it's being POSTed or GETted
properly. You might need to use $_POST['products'] or
$_GET['products'].
--- Aaron Wolski <aaronjw@martekbiz.com> wrote:
> Argh !!!!!!!!
>
>
> HOW does one check for an array being empty from a form
> field??????????
>
> Tried a billion different things and NOTHING works!!!!
>
> I've tried:
>
> if ($products == "\n") {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> if ($products == "") {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
>
> if (empty($products)) {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> if (!isset($products)) {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> if (count($products) == 0) {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> NOTHING works!!!
>
> Any help.. puuulease?
>
> Aaron
>
=====
Mark Weinstock
mark_weinstock@yahoo.com
***************************************
You can't demand something as a "right" unless you are willing to fight to death to
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***************************************
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com