Jump to content

[SOLVED] Changing colours for echo


SirChick

Recommended Posts

If i have an echo which can change.. which i currently have this:

 

<font style="font-size:16px" color="#FFFFFF" face="Arial"><b><u><?= $ResultQuote ?></u></b></font></div>

 

 

How do i change it so that the colour will change depending on the what the $ResultQuote is?

Link to comment
Share on other sites

if($ResultQuote = '$100')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo $ResultQuote;
echo '</font></div>';
}else if($ResultQuote = '$200')
{
echo '<font style="font-size:16px" color="yellow" face="Arial">';
echo $ResultQuote;
echo '</font></div>';
}else if($ResultQuote = '$300')
{
echo '<font style="font-size:16px" color="red" face="Arial">';
echo $ResultQuote;
echo '</font></div>';
}

Link to comment
Share on other sites

aye i was just about to say lol!

 

 

But can you do it with captions?

 

<?

if($ResultQuote == 'Result: You search the train station from top to bottom and find $1!')

{

echo '<font style="font-size:16px" color="green" face="Arial">';

echo $ResultQuote;

echo '</font></div>';

}else if($ResultQuote == 'You failed to find any money, better try some other time!')

{

echo '<font style="font-size:16px" color="red" face="Arial">';

echo $ResultQuote;

echo '</font></div>';

}else if($ResultQuote == 'Result: You search the train station from top to bottom and find $3!')

{

echo '<font style="font-size:16px" color="green" face="Arial">';

echo $ResultQuote;

echo '</font></div>';

}else if($ResultQuote == 'Result: You search the train station from top to bottom and find $5!')

{

echo '<font style="font-size:16px" color="green" face="Arial">';

echo $ResultQuote;

echo '</font></div>';

}

?>

 

 

this is what i put.. but it just displays nothing.. ?

 

the $ResultQuote is created in an include else where... just encase you wondered why i compare them to strings

Link to comment
Share on other sites

hmm it doesnt echo it. good spot. gah that is rediculously annoying lol so many lines to look through *cries* lol

 

 

would any one care to take a look ? i cant post it here though way too much to post and im not comfortable posting my work too everyone :/

Link to comment
Share on other sites

change

else if($ResultQuote == 'Result: You search the train station from top to bottom and find $5!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo $ResultQuote;
echo '</font></div>';
}

to

else if($ResultQuote == 'Result: You search the train station from top to bottom and find $5!')
{
echo '<font style="font-size:16px" color="green" face="Arial">';
echo $ResultQuote;
echo '</font></div>';
}else
{
echo 'none of those';
echo $ResultQuote;
}

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.