webguync Posted March 16, 2010 Share Posted March 16, 2010 Hi, I have some code, which echos' out two different things if a percentage criteria is met. [php <td><?php if(($pcnt[$i]*100) > 89) { echo "<div class='passed'>" .Passed."</div>"; } else { echo "<div class='failed'>" .Failed. "</div>"; } ?></td> [/code] I want to create another echo further up the page that displays something if the result is echo "<div class='failed'>" .Failed. "</div> can I do that if this criteria is not met yet? If so how? Let me know if I need to clarify anything. Link to comment https://forums.phpfreaks.com/topic/195479-if-criteria-is-met-echo-text-question/ Share on other sites More sharing options...
ksugihara Posted March 16, 2010 Share Posted March 16, 2010 The application would not be able to figure out whether he has passed or failed until you evaluate it. This is one of the downfalls to linear programming. Link to comment https://forums.phpfreaks.com/topic/195479-if-criteria-is-met-echo-text-question/#findComment-1027211 Share on other sites More sharing options...
webguync Posted March 16, 2010 Author Share Posted March 16, 2010 ok, that is what I was afraid of. I guess I could do another if statement below that. Link to comment https://forums.phpfreaks.com/topic/195479-if-criteria-is-met-echo-text-question/#findComment-1027240 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.