replace wordpress login with my custom web application login

Solution:1

You can do the stuff in the following way:

Keep wordpress folder name blog/ in your project root dirtectory. And then create wordpress user with same credentials such as your application. Put the below code in your application when you create new login user:

require_once('blog/wp-blog-header.php');
require_once('blog/wp-includes/registration.php');
$newusername = 'xxxxxxxxxxx';
$newpassword = 'xxxxxxxxxxx';
$newemail = 'xxxxxxx@xxxxxxx.co.in';
// Check that user doesn't already exist
if ( !username_exists($newusername) && !email_exists($newemail) ){
   // Create user and set role to administrator
   $user_id = wp_create_user( $newusername, $newpassword, $newemail);
   if ( is_int($user_id) )      {
       $wp_user_object = new WP_User($user_id);
       $wp_user_object->set_role('contributor');
            echo 'Successfully created new user.';
    } else {
            echo 'No users were created.';
    }
} else {
    echo 'This user or email already exists. Nothing was done.';
}

Hope this will helps.

Solution:2

If you want to customize the current wordpress login page (usually wp-login.php) you should take a look at WordPress Codex for Customizing the Login Form.

Or if you want to create a separate login page for your theme, I suggest you to use Theme My Login to do this.

This plugin themes the WordPress login, registration and forgot password pages according to your current theme. It creates a page to use in place of wp-login.php, using a page template from your theme. Also includes a widget for sidebar login.

Plugin Features

  • Your registration, log in, and password recovery pages will all match the rest of your website
  • Includes a customizable widget to login anywhere from your blog
  • Redirect users upon log in and log out based upon their role
  • Show gravatar to users who are logged in
  • Assign custom links to users who are logged in based on their role
  • Customize user emails for registration and/or password recovery
  • Send user emails in HTML format
  • Allow users to set their own password upon registration
  • Require users to be approved or confirm e-mail address upon registration
  • Theme user profiles