A common sighting in the forums this topic never seems to delve further than the authors patience with the profile themes, so here’s a quick “How To”.
Firstly, you will need to ‘generate’ the html needed, this can be as simple as visiting the default registration page, default /member/register/.
Take the minimum required HTML (for this example, there are no custom fields involved)
<form id='register_member_form' method="post" action="http://www.example.com/" >
<input type="hidden" name="XID" value="f5f63ec418563c0bc141ce307cca4d990cad0531" />
<input type="hidden" name="ACT" value="7" />
<input type="hidden" name="RET" value="http://www.example.com/" />
<input type="hidden" name="FROM" value="" />
<input type="text" name="username" value="" maxlength="32" class="input" size="25" style="width:300px" />
<input type="password" name="password" value="" maxlength="32" class="input" size="25" style="width:300px" />
<input type="password" name="password_confirm" value="" maxlength="32" class="input" size="25" style="width:300px" />
<input type="text" name="email" value="" maxlength="120" class="input" size="40" style="width:300px" />
<input type="text" name="url" value="" maxlength="100" class="input" size="25" style="width:300px" />
<input type='checkbox' name='accept_terms' value='y' />
<input type="submit" value="Submit" class="submit" /></p>
</form>
The first amendment is you will need to insert “{XID_HASH}” as the value for the hidden “XID” form field. This will generate the necessary XID hash and corresponding database entry.
The hidden ACT form field is the action ID assigned to the register_member function within the exp_actions table. You can either hard code this number in the template, or use some PHP to retrieve the correct ID. Something like this would be suitable:
<?php
global $FNS;
$action_id = $FNS->fetch_action_id('Member', 'register_member');
?>
Placing the above html code with all relevant changes made:
- Inserting {xid_hash}
- Insert correct ACT id
- Ensuring the form action URL is that of your own site ;]
Should give you the desired registration form.
For CAPTCHA to work with a custom built stand alone registration form, remove the if statement. It should look like
<p>Please enter the word you see in the image below:</p>
<p>{captcha}<br />
<input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" /></p>
More information on working with CAPTCHAS can be found in the userguide.
Category:Members Category:Templates Category:Tricks
