Jump to content

[SOLVED] New To PHP - Please help with 'else'.


g3mma111

Recommended Posts

Im fairly new to PHP and am having a problem with the following script:

<? if ($gender='F') { ?>

<img name="" src="/images/woman.jpg" width="101" height="140" alt=""> 

<? 
}
else
{
?>
<img name="" src="/images/man.jpg" width="101" height="140" alt="">
<?
 }
 ?>

 

I am trying to make it so that if gender is F then a woman pic gets displayed and otherwise it is a man one. Can anyone see where ive gone wrong? at the moment it just displays a woman pic regardless of what the gender is.

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.