Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: PHP - Help

  1. #11
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    your problem is you havent elsed the rest, if your condition is met it does whats between the {} but it doesnt stop whats happening after, the white name from occuring too..

    Its easy to fix though thanks to else.

    PHP Code:
    <div align="left">

    <?php 

    if($info->rank =='Official Bliss Godfather'){
    echo
    "<b><font color='red'>Official Bliss Godfather</font>"
    }else{
    echo 
    "<b><font color='white'>".$fetch->rank."</b>";
    }
    ?> 
    </div>
    Basicly the only change other than some syntax for it to work, is that i put the white name as an else, so if it doesnt do a red name it falls back to the white, but if it does do the red, it doesnt do the white as well.

    hope that helps

    ps, just wondering is there a reason you have a fetch and an info class which are both holding the exact same information in there rank varible?
    Last edited by Mentor; 19-08-2007 at 01:29 PM.

  2. #12
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by 01101101entor View Post
    your problem is you havent elsed the rest, if your condition is met it does whats between the {} but it doesnt stop whats happening after, the white name from occuring too..

    Its easy to fix though thanks to else.

    PHP Code:
    <div align="left">

    <?php 

    if($info->rank =='Official Bliss Godfather'){
    echo
    "<b><font color='red'>Official Bliss Godfather</font>"
    }else{
    echo 
    "<b><font color='white'>".$fetch->rank."</b>";
    }
    ?> 
    </div>
    Basicly the only change other than some syntax for it to work, is that i put the white name as an else, so if it doesnt do a red name it falls back to the white, but if it does do the red, it doesnt do the white as well.

    hope that helps

    ps, just wondering is there a reason you have a fetch and an info class which are both holding the exact same information in there rank varible?
    O hey it worked perfectly.Thanks alot Rep+!

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •