I am trying to hide the login and register button once the user is registered. It doesn't work as expected as it hides the login and SIGN UP butoon, but it doesn't bring them back once logged out. Below is the PHP code.
<div class="login"><a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">LOG IN</a></div>
<div class="login"><a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">SIGN UP</a></div>
$message = $_SESSION['valid_user'];
<div class="message">
<?php
echo "$message";
?>
</div>
Below is the jQuery code:
$(document).ready(function(){
x = $(".message").text().length;
if ( x >=1) {
$(".login").hide();
}
else {
$("#logout").hide();
}
});