I am doing movie website.
I'm asking for the "base" script to check if certain user is logged in or not to have acess to the videoplayer.
Problem Statement: At present, it shows even if the user is not logged in, I want to change that.
So far i came up with this code, but it always return true, because my var takes the value of the $_Session as text.
<p>Click the check user:</p>
<button onclick="checkuser()">Try it</button>
<p id="demo"></p>
<script>
function checkuser()
{
var greeting;
var userlog = '<%= Session["SessionKey"] %>'; // dreamweaver error here
if (userlog==null)
{
greeting = "Bye"; // here - i will not show content
}
else {
greeting ="Go ahead"; // here - i will show content
}
document.getElementById("demo").innerHTML = greeting;
}
</script>