Page 1 of 1

"greater than or equal" code?

Posted: Sun May 20, 2007 2:17 pm
by thefreebielife
is there a code that would make this work:

Code: Select all

<? if ($count2 >= $gref && $ostatus == 1 && $count4 == 0) { echo "<div align=center><font color=#009900>Congrats!  You Are Ready To Order Your Free Gift. </font><font color=red><a href=\"order.php\"> Click To Order</a></font><Br>Make Sure Your Information Is Correct Before Ordering.  It Cannot Be Changed</div>"; } ?>
if the ostatus value could be 1 or greater than 1 for multiple users?

thanks in advance

Posted: Sun May 20, 2007 2:30 pm
by volka
$count2 >= $gref
$count2 is equal or greater than $gref
...what was the question again?

Posted: Sun May 20, 2007 2:34 pm
by thefreebielife
well say ostatus was 1.02.. then it would throw that off right?

Posted: Sun May 20, 2007 2:36 pm
by volka
Yes, but you should already know how to perform a greater-or-equal test ...it's already in your code.

Posted: Sun May 20, 2007 2:40 pm
by thefreebielife
im support for the site, i didnt write the code and know little about php.

can someone help?

Posted: Sun May 20, 2007 2:48 pm
by thefreebielife
i did this already:

Code: Select all

($count2 >= $gref && $ostatus >= 1 && $count4 == 0)
But if the user's ostatus is 1 but their referrals is 1.02 it still doesnt work

Posted: Sun May 20, 2007 2:53 pm
by volka
hm,

Code: Select all

$count2 = $gref = 1;
$ostatus = 1.02;
$count4 = 0;


if ($count2 >= $gref && $ostatus >= 1 && $count4 == 0) {
	echo 'true';
}
else {
	echo 'false';
}
my php prints true as expected.

Posted: Sun May 20, 2007 2:55 pm
by thefreebielife
but this is the confusing part: this code can be true even if ostatus OR gref are 1 or 1.02

Posted: Sun May 20, 2007 3:03 pm
by volka
thefreebielife wrote:this code can be true even if ostatus OR gref are 1 or 1.02
You want it that way?
The condition is: $ostatus OR $gref greater-or-equal 1 ?

Posted: Sun May 20, 2007 3:16 pm
by thefreebielife
i figured out the problem.

it was a different part of the code.

sorry but thanks for helping!

:)