View Single Post
Old Apr 30th, 2006, 3:48 PM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,868
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Two things...

I'm not exactly sure what ...if ($a || $b || $c === 0)... is supposed to do, but I believe that it should be ...if ($a == 0 || $b == 0 || $c == 0) ... to check if all of them equal 0.

You also have to make sure that $a, $b and $c all equal something first.

Here's a working example of what you have:

[php]<?php

$a = 1;
$b = 1;
$c = 1;

if ($a == 0 || $b == 0 || $c == 0)
{
echo ("please fill in all fields");
print ("please fill in all fields");
}
else
{
echo ("all fields were filled in");
print ("all fields were filled in");
}

?>[/php]

And here's an article on the differences between "echo" and "print": http://www.faqts.com/knowledge_base/...l/aid/1/fid/40

I don't see why you need to use both here. *confused*
Sane is online now   Reply With Quote