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
https://forums.phpfreaks.com/topic/65015-solved-new-to-php-please-help-with-else/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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