Okay so I have a script to check to see if someone has logged in. But the login it still displays the form to login. Here is the current script:
<?php
if(session_is_registered(myusername)){
echo $_SESSION['myusername'];
echo "<br /><a class='linkText' href='logout.php'>Logout!</a></div>";
}
else{
$login_form=<<<'LOGIN'
Login<br /><br /><div class="heading_02">
<form name="form2" method="post" action="checklogin.php" style="display:inline">
<input type="text" name="myusername" id="myusername" class="user" /><br />
<input type="password" name="mypassword" id="mypassword" class="pass" /><br />
<input type="submit" name="Submit" value="Login" class="green_login_02" />
</form>
<a style="color: #A2FF00; text-decoration: none;" href="signup.php">Sign-up</a>
</div>
LOGIN;
echo $login_form;
}
?>
Just as an extra side note this part of like a clamp figuratively speaking so this is inside the first half of a clamp. The clamp syntax goes like this:
<? include("clamp1.php"); ?>
content
<? include("clamp2.php"); ?>
This appears in the first half of the clamp if that is any help.
Works, the function session_is_registered is DEPRECATED (http://php.net/manual/en/function.session-is-registered.php). try making methods to check if a session variable is set. Don`t forget session_start()