hello guys,
i'm having a problem again with my php code.
when i login to my site my login box is ment to disappear when i login and show my username and a link to the login page but it isnt doing that it keeps showing the login box can anyone help me please?.
you can see what i mean if u login using
mark
d82f1fc
when they login it should show this part of the code.
if they arent logged in it should showPHP Code:if ($username){
echo "$username | <a href='logout.php'>Logout</a>";
}
This is the full code below.PHP Code:echo "<form action='login.php' method='post'>
<center><table>
<tr>
<td>Username</td>
<td><input type='text' name='username' class='textbox' size='35'></td>
<td><a href='register.php'>Register</a></td>
</tr>
<tr>
<td>Password</td>
<td><input type='password' name='password' class='textbox' size='35'></td>
<td><input type='submit' name='loginbtn' value='Login' class='button'></td>
</tr>
</table></center>
</form>";
PHP Code:<?php
if ($username){
echo "$username | <a href='logout.php'>Logout</a>";
}
else
echo "<form action='login.php' method='post'>
<center><table>
<tr>
<td>Username</td>
<td><input type='text' name='username' class='textbox' size='35'></td>
<td><a href='register.php'>Register</a></td>
</tr>
<tr>
<td>Password</td>
<td><input type='password' name='password' class='textbox' size='35'></td>
<td><input type='submit' name='loginbtn' value='Login' class='button'></td>
</tr>
</table></center>
</form>";
?>

