Forums

Custom Login Form Not Working (3 posts)

  1. michaelburk
    Member
    Posted 5 months ago #

    Hi All,

    I've placed a login form on a page within my WordPress site so that users don't have to go to the default wp-login.php page to login. The site is also using a redirect plugin as well as a group-level access restriction plugin that allows me to do the following:

    1. User lands on custom login page
    2. User enters username/password
    3. User is redirected to specific page that is only accessible by that user

    The problem I'm having is that my custom login page doesn't appear to be logging in the user correctly. When I login on my custom page, the user is redirected to the private page, but the page does not recognize the the user is logged in (and thus throws an error). However, when I login via wp-login.php everything works as expected.

    This makes it seem like there's something that's not working correctly on the custom login form, since the workflow functions correctly when I login via the traditional login page.

    Here's the code I'm using to add the login from on my custom page:

    <form class="loginform" action="http://ralphburk.com/wp-login.php" method="post" >
    		<p>
    			<label for="user_login">Username:</label>
    			<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10">
    			<br/>
    			<label for="user_pass">Password:</label>
    			<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20">
    			<br/>
    		</p>
    
    		<p class="submit">
    			<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="LogIn" tabindex="100">
                            <input type="hidden" name="testcookie" value="1">
    		</p>
    	</form>

    This was ripped straight out of wp-login.php, and I have another site that uses nearly identical code. Any idea what might be causing the failed login?

    I'm running WordPress 3.3, Peter's Login Redirect 2.6.0, and User Access Manager 1.2.1. Thanks in advance for your help!

  2. deepbevel
    Member
    Posted 5 months ago #

    Does login work without the redirect? might try disabling the redirect plugin just to see..

  3. michaelburk
    Member
    Posted 5 months ago #

    I disabled the redirect plugin and when I login now it redirects me to wp-login.php with a bunch of additional arguments in the URL (http://www.ralphburk.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.ralphburk.com%2Fwp-admin%2Fprofile.php&reauth=1).

    The redirect plugin was working correctly before if I logged in directly from wp-login.php. It's only when I login on my custom form that the page restriction error is thrown.

Reply

You must log in to post.

About this Topic