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.