Viewing 6 replies - 1 through 6 (of 6 total)
  • The code should look like this.

    <?php global $userdata;
          get_currentuserinfo();
    if (!is_user_logged_in())
    {
    echo "Hello there, Guest..."; ?>
    <form action="wp-login.php" method="post">
    Username: <input type="text" name="log" id="user_login" class="input" />
    Password:<input type="password" name="pwd" id="user_pass" class="input" />
    <input type="hidden" name="testcookie" value="1" />
    <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember Me
    <input type="submit" name="wp-submit" id="wp-submit" value="Log In" />
    </form>
    <?php else {
    echo 'Welcome back' . $userdata->user_login . 'Logout.';
    } ?>

    Thread Starter miruru

    (@miruru)

    Thank you, i’ve copied what you’ve put, however I now get this error:
    Parse error: syntax error, unexpected T_ELSE in siteurl on line 13

    Where are you pasting this code. There is no mention of siteurl anywhere is this code there is something somewhere else. It might help if you paste the contents of the file you trying to put this in to http://wordpress.pastebin.ca and give a link here.

    Thread Starter miruru

    (@miruru)

    i put “siteurl” so that my actual website url is not displayed.
    I’ve pasted what you wrote exactly into a file called “login.php” which I then called it in my header.php file using the php include tag.

    I see the problem now there was more than one error in the original code you posted.

    <?php global $userdata;
          get_currentuserinfo();
    if (!is_user_logged_in())
    {
    echo "Hello there, Guest..."; ?>
    <form action="wp-login.php" method="post">
    Username: <input type="text" name="log" id="user_login" class="input" />
    Password:<input type="password" name="pwd" id="user_pass" class="input" />
    <input type="hidden" name="testcookie" value="1" />
    <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember Me
    <input type="submit" name="wp-submit" id="wp-submit" value="Log In" />
    </form>
    <?php } else {
    echo 'Welcome back' . $userdata->user_login . 'Logout.';
    } ?>

    Thread Starter miruru

    (@miruru)

    thank you so much, that has now work.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘login form display’ is closed to new replies.