adding user via php
-
i have a multisite which is running fine .I also have a website in php which have a user base.
I need to make a user in wordpress when someone register in my php website.
i am trying to write the code for username validation,if this works then I can use other wordpress function to create the user.Can anyone help me out in finding where I have done wrong in the code.
my code is<?php //the include is working fine require_once('D:\wamp/www/d2mail/wp-blog-header.php') ; //taken this variable for testing purpose $user_name="admin" ; $password="admin"; $password=md5($password); $email="admin@admin.com"; $user_id = wp_create_user($user_name, $password, $email) ; // check if there was an error if (is_wp_error($user_id)){ if (!isset($errhandler)){ $errhandler= new apperrors() or die ("unable to creat instance of app errors") ; } $errhandler->add($user_id->get_error_message(),"my_wp_class->add_user") or die("unable to add record to errors - $user_id");; } ?>I have receiving an error message as
Fatal error: Call to undefined function wp_create_user() in D:\wamp\www\multiregistration\register.php on line 11thank you in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘adding user via php’ is closed to new replies.