I have an html page and what I want is that when logging in on the same page, the logIn link is hidden and the logOut appears. How could I do it?
<div id='page-wrap'>
<header class='main' id='h1'>
<span class="right"><a href='../PHP/signUp.php'>SignUp</a> </span>
<span class="right" style="display:none;"><a href="../PHP/logout">LogOut</a> </span>
<span class="right" style="display:none;"><a href='../PHP/logIn.php'>LogIn</a> </span>
What I was doing before was logearme go to another page but what I want to do now is that the same page change.
@Francisco Romero what I need is that without changing the page I updated the link from logIn to logOut and for that I understand that I have to use AJAX. Regarding what I have done is this:
<?php
if($_SESSION["login"]){
echo "<span class="right" style="display:none;"><a href="logout">LogOut</a> </span>";
echo "<span> Anonimo </span>";
}else{
echo "<span class="right" style="display:none;"><a href='logIn.php'>LogIn</a> </span>";
echo "<span> Erabiltzailea : <?php echo $_SESSION['login']; ?> </span>";
}
?>