i have two websites, websiteA is a worpdress website, and websiteB is a simple php website. i want to link the two website. i have a form in websiteB and i want it to be able to add users in websiteA. i already tried the code below , it creates user but redirect to websiteA while i am in websiteB:
<form name="myForm" action="http://ipSiteA/wp-admin/user-new.php" method="post">
<input type="hidden" name="action" value="createuser">
<input type="hidden" name="user_login" value="test">
<input type="hidden" name="email" value="[email protected]">
<input type="hidden" name="pass1" value="test">
<input type="hidden" name="pass2" value="test">
<input type="hidden" name="role" value="seller">
<input type="hidden" name="createuser" value="Ajouter un utilisateur">
<input type="hidden" name="_wpnonce_create-user" value="815389c6d9">
<input type="hidden" name="_wp_http_referer" value="/wp-admin/user-new.php">
<input type="submit" name="create" value="Creer">
is there any other solution using remote apli for example? if not, is there a way to not be redirected to websiteA? thanks
You can set up a hook on the registration method on the site, where you need it. Open your
functions.php
in your websiteB. This is in your theme directory. If there is no file like this, create one.Put this into that file:
Of course, you need to write your URL instead of the example.com.
Here is the referenc of the
register_form
action.