Jump to content

[SOLVED] elseif problems


graham23s

Recommended Posts

Hi Guys,

 

damn my brain hurts lol firstly the value of $free = 20

 

im trying to do a little credit system but its gone wrong somewhere

 

code:

 

           if(($free) > 15) {
           
           echo "$free <img src=\"images/grin.gif\">";
           
           } elseif (($free) < 5) {
           
           echo "$free <img src=\"images/cry.gif\">";
           
           } elseif (($free) == 0) {
           
           echo "<font color=red>0</font> No Credit Left!";
          
           } else {
           
           echo "$free <img src=\"images/smile1.gif\">";
           
           }

 

if the credit is > 15 then display a grin icon, if its less than 5 a cry icon if its 0 then theres no credit left, the rest of the time just a normal smile gif can nayone see anyproblems? because i have < 5 it interefers with the == 0 code

 

thansk guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/68567-solved-elseif-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.