Forum Moderators: coopster

Message Too Old, No Replies

Using "Empty" with multiple Variables

         

dkin

5:41 pm on Aug 17, 2004 (gmt 0)

10+ Year Member



I am trying to make sure that 2 fields are filled before I insert them into my database.

I tried this.

if (empty($var1 ¦¦ $var2)){
print "One of your variables are empty.";
exit;
}

But that does not work, hwo do others do this?

cheers.

timster

5:52 pm on Aug 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just feed empty 1 variable at a time:

if (empty($var1) ¦¦ empty($var2)){
print "One of your variables is empty.";
exit;
}

dkin

5:59 pm on Aug 17, 2004 (gmt 0)

10+ Year Member



that worked well, thank you Tim