WordPress.org

Ready to get started?Download WordPress

Forums

Automatically remember me (3 posts)

  1. davey579
    Member
    Posted 7 years ago #

    I'm using a login form on my index including a 'remember me' checkbox, now i want to remove the checkbox, but everyone who logs in has to set to 'remember'. Is this possible to do without a checkbox?

    My login form code:


    <div id="login">

    <?php
    if ( $error )
    echo "<div id='login_error'>$error</div>";
    ?>

    <form name="loginform" id="loginform" action="wp-login.php" method="post">
    <input style="font-size: 9px; border:none; background: #595959; color:#fff" type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1); ?>" size="7" tabindex="1" />

    <input style="font-size: 9px; border:none; background: #595959; color:#fff" type="password" name="pwd" id="pwd" value="" size="7" tabindex="2" />

    <input type="submit" class="submit" name="submit" id="submit" value="" tabindex="4" />

    <div id="checkbox"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</div>
    <input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($redirect_to); ?>" />

    </form>
    </div>

  2. Chris_K
    Member
    Posted 7 years ago #

    Try replacing:

    <input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />

    with:

    <input name="rememberme" type="hidden" id="rememberme" value="forever" tabindex="3" />

    Cheesy, but ought to work.

  3. davey579
    Member
    Posted 7 years ago #

    I think it works, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.