PHP If, else and endif and HTML


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php if ($me): ?>
  2. <a href="<?php echo $logoutUrl; ?>">
  3. <img src="http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif">
  4. </a>
  5. <?php else: ?>
  6. <div>
  7. Using JavaScript &amp; XFBML: <fb:login-button></fb:login-button>
  8. </div>
  9. <div>
  10. Without using JavaScript &amp; XFBML:
  11. <a href="<?php echo $loginUrl; ?>">
  12. <img src="http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif">
  13. </a>
  14. </div>
  15. <?php endif ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.