Results 1 to 13 of 13

Thread: [RESOLVED] login problem

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2004
    Posts
    1,202

    Resolved [RESOLVED] login problem

    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.

    PHP Code:
    if ($username){
        echo 
    "$username | <a href='logout.php'>Logout</a>";

    if they arent logged in it should show

    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>"

    This is the full code below.

    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>"
    ;

    ?>
    Last edited by Jamie_Garland; Feb 10th, 2013 at 06:26 PM.
    come back and mark your original post as resoved if your problem is fixed

    Jamie Garland

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width