How do I hide the authorization form when the user is signed in? Instead, I want the user to see: Welcome, %username%
.
My code so far
<?if(!isset($_SESSION['id'])):?>
<form action="testreg.php" method="post" }>
<p>
<label><span">Username:</span></span><br>
</label>
<input name="login" type="text" size="25" maxlength="15">
</p>
<p>
<label><span class="style3">Password:</span><br>
</labe l>
<input name="password" type="password" class="style3" size="13"
maxlength="15">
</p>
<p><input name="submit" type="submit" value="Enter">
<a href="reg.php" class="style4">Need an account?</</a></p>
</form>
<?php
if (empty($_SESSION['login']) or empty($_SESSION['id']))
{
echo "You have signed in<br><a href='#'>Available only for you</a>";
}
else
{
echo "Welcome, ".$_SESSION['login']."<br><a href='link'>Profile</a>";
}
?>
<?endif?>