PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
thefreebielife
Forum Contributor
Posts: 126 Joined: Thu Apr 26, 2007 2:59 pm
Post
by thefreebielife » Sun May 20, 2007 2:17 pm
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
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun May 20, 2007 2:30 pm
$count2 >= $gref
$count2 is equal or greater than $gref
...what was the question again?
thefreebielife
Forum Contributor
Posts: 126 Joined: Thu Apr 26, 2007 2:59 pm
Post
by thefreebielife » Sun May 20, 2007 2:34 pm
well say ostatus was 1.02.. then it would throw that off right?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun May 20, 2007 2:36 pm
Yes, but you should already know how to perform a greater-or-equal test ...it's already in your code.
thefreebielife
Forum Contributor
Posts: 126 Joined: Thu Apr 26, 2007 2:59 pm
Post
by thefreebielife » Sun May 20, 2007 2:40 pm
im support for the site, i didnt write the code and know little about php.
can someone help?
thefreebielife
Forum Contributor
Posts: 126 Joined: Thu Apr 26, 2007 2:59 pm
Post
by thefreebielife » Sun May 20, 2007 2:48 pm
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
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun May 20, 2007 2:53 pm
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.
thefreebielife
Forum Contributor
Posts: 126 Joined: Thu Apr 26, 2007 2:59 pm
Post
by thefreebielife » Sun May 20, 2007 2:55 pm
but this is the confusing part: this code can be true even if ostatus OR gref are 1 or 1.02
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun May 20, 2007 3:03 pm
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 ?
thefreebielife
Forum Contributor
Posts: 126 Joined: Thu Apr 26, 2007 2:59 pm
Post
by thefreebielife » Sun May 20, 2007 3:16 pm
i figured out the problem.
it was a different part of the code.
sorry but thanks for helping!