I need help with this;
I added this line of PHP code in a menu option using sourcerer.
<li style="list-style:none;">
<?php
$user = JFactory::getUser(); {
$userToken = JSession::getFormToken();
echo '<a href="index.php?option=com_users&view=login&layout=logout' . $userToken . '=1;" >Logout ' .'</a>';
}
?>
</li>
Now, I need to redirect to a page once the user clicks this menu link.
I would like to redirect the user to the home page.
Now, when I use this link to logout it just goes to an empty page.
What am I doing wrong and how can I fix it?