Jump to content

Help Inserting an image in an if statement


christine75

Recommended Posts

Hi everyone,

It's my first time here in on this forum [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

I'm having a problem inserting a image in my if statment. A little background, this statement below checks to see if my friend is online, if she is, then it is suppose to show an image of a star beside her name.

Right now, the statement is written like this below. When she's online, it echos/prints a * beside her name.

<?if ($friend[online]) echo "*";?>

I want to modify it so that when she's online, instead of the *, I want a picture of a star (length 16 by width 16). I tried to insert the statement below but I got an error [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]


<?if ($friend[online]) img src "images/star.gif" length="16" width ="16";?>

As you can tell, I'm a newbie when it comes to php, can anyone help me and tell me how the statement should be written.

Thanks in advance [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]

Christine
Link to comment
Share on other sites

You will need to put whatever you want to display inside the echo() function.

[code]<?if ($friend[online]) echo('<img src "images/star.gif" length="16" width ="16">');?>[/code]

[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--]
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.