Hi and first of all thanks to everyone here that takes the time to help out newbies such as myself. I have a conditional IF statement that allows me to add a link to a piece of text if that record has a website, but I would like to also be able to display the text without the link if there is no website associated with the record.The code that I am currently using is
<?php if($row_RSsales['website']!='') { ?><a href="<?php echo $row_RSsales['website']; ?>" target="_blank"><?php echo $row_RSsales['name']; ?></a><?php } ?>
The trouble with this is that if a particular record does not have a website then the code does not echo the business name. I would like to include an ELSE statement with the IF statement so that when a record does not have a website entry the business name is still echoed, but not hyperlinked.I have been fiddling with code but cannot figure out how to do it.
<?php if($row_RSsales['website']!='') { ?><a href="<?php echo $row_RSsales['website']; ?>" target="_blank"><?php echo $row_RSsales['name']; ?></a>;else <?php echo $row_RSsales['name']; ?><?php } ?>
doesn't work and I am not sure how to solve it.Any suggestions would be greatly appreciated!thanks,Graham