In the header of the Home.html file, I use the $session function like this
<?php
@session_start();
if( $_SESSION['flag']==1)
echo'<script>window.location="login.html";</script>';
?>
While in the code above it only directs the user to the login file if they has not login yet.
What I want now is if the user has not login yet then they are still able to acess the home.html file however there are some content that I want to hide to the unregistered user.
I use this code to generate this:
$(document).ready(function(){
$check=1;
$("span").click(function(){
if($check==0)
{
$("#login").show();
$("#logout").hide();
}
else
{
$("#logout").show();
$("#login").hide();
}
});
});
So my question now, What I need to change in the header of the html file (in the session function) so that it can be combined with the $Check function?"