How to Display Custom Myaccount, Login and Logout link on header in Magento:

 

<?php

$loggedIn = $this->helper("customer")->isLoggedIn();

if($loggedIn == 1){

echo "<a href=\"".Mage::getBaseUrl()."customer/account/\" />My Account</a>";

} //If the user is logged in, then show a button to logout.

else

{

echo "<a href=\"".Mage::getBaseUrl()."customer/account/create/\" />Register</a>";

} //If the user is not logged in, then show a button to login

?>

 

 

 

<?php

$loggedIn = $this->helper("customer")->isLoggedIn();

if($loggedIn == 1)

{

echo "<a href=\"".Mage::getBaseUrl()."customer/account/logout/\" />LOGOUT</a>";

} //If the user is logged in, then show a button to logout.

else

{

echo "<a href=\"".Mage::getBaseUrl()."customer/account/\" />LOGIN</a>";

} //If the user is not logged in, then show a button to login

?>