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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.