本文實例講述了Joomla簡單判斷用戶是否登錄的方法。分享給大家供大家參考,具體如下:
<?phpif (isset($_SESSION['auth']["username"])){ echo "Welcome <a href='index.php?option=com_user&view=user&task=edit'>" . $_SESSION['auth']["username"] . "</a>!"; }else{ echo "<a href='index.php?option=com_user&view=login'>Log in</a>"; }?>