Support » Plugin: Login With Ajax » What is the best way to add forms to register

  • Hi Marcus,

    I am implementing a process for register.
    Because there are several types of users, sufficiently different to have different forms (which themselves have conditional fields), I am looking for the best way to implement a compatible process with Loginwithajax.
    Currently for “register” LoginWithAjax launches the default url https://.../wp-login.php?action=register

    One solution is to simply add_action (‘init’, ‘function_name’) and build the various need functions (user meta data), widgets etc…
    Another could be to move everything to wpforms plugin, I have not chosen this way.
    A third way is to follow LWA but add the best compatible forms submissions.

    In this last way, which I prefer, there are probably some recommendations to follow.

    Best regards

    Trebly

Viewing 1 replies (of 1 total)
  • Hi,

    I have used a particular solution which is near ajax.

    The action=register runs a php which displays a page which contains a form for the choice of registering procedure.

    When the form is submitted a new action is launched. The php for this action has the role to launch the corresponding form (there four different forms) without displaying anything visible (except if an error occurs which stops the process).

    This php will launch the final page(s) by using an intermediate “pseudo page” which using a short js script loads immediately the wished final page.
    The intermediate page is generated simply with these four echo (note : $registering_page is the url chosen for registering) :

    echo('<meta name="referrer" content="origin">');
    	echo ("<html><head><script> reg= function() 
                                {window.open(\"$registering_page\");}</script></head>");
    	echo ('<body onload="reg()">');
    	echo('</body></html>');

    Best regards

    Trebly

    note : Markus, you can, after reading, mark this thread as solved

Viewing 1 replies (of 1 total)
  • The topic ‘What is the best way to add forms to register’ is closed to new replies.