[ic] Making email a required field when a new account is created?
Shawn Mathews
interchange-users@icdevgroup.org
Wed Sep 25 14:04:01 2002
I am having an interesting problem....
I want to make sure only unqiue email addresses are used when accounts are
created. I'd also like to make email address a required field when a new
account is created.
I changed my database and added a unique index on the email field, and added
an additional userdb function to my new_account.html to save the email
address.
This works as long as the email address doesn't already exist in the
database. When a non-unique email address is entered, Intechange just
changes it to blanks.
Here is my code:
[if session logged_in][bounce href="[area account]"][/if]
[if !scratch new]
[if session failure]
<P>
<b>[data session failure]</b>
[data base=session field=failure value=""]
<P>
[/if]
[else]
[set new][/set]
[/else]
[/if]
<table border="0" cellspacing="0" cellpadding="0">
[set NewAccount]
[if type=explicit compare="[userdb new_account]"]
mv_nextpage=account
[else]
mv_nextpage=new_account
[/else]
[/if]
[/set]
<FORM ACTION="[process-target]" METHOD=POST>
<input type=hidden name=mv_session_id value="[data session id]">
<INPUT TYPE=hidden NAME=mv_click VALUE=NewAccount>
<INPUT TYPE=hidden NAME=mv_doit VALUE=return>
<INPUT TYPE=hidden NAME=function VALUE=new_account>
<INPUT TYPE=hidden NAME=function VALUE=set_preferences>
<INPUT TYPE=hidden NAME=mv_nextpage VALUE="[value mv_nextpage]">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td align="right"">
<b>Username:</b>
</td>
<td align="left">
<input type="text" NAME=mv_username VALUE="">
</td>
</tr>
<tr>
<td align="right" >
<b>Password:</b>
</td>
<td align="left">
<INPUT TYPE=password NAME=mv_password VALUE="">
</td>
</tr>
<tr>
<td align="right" >
<b>Verify Password:</b>
</td>
<td align="left" >
<INPUT TYPE=password NAME=mv_verify VALUE="">
</td>
</tr>
<tr>
<td align="right" >
<b>Email:</b>
</td>
<td align="left" >
<INPUT TYPE=text NAME=email VALUE="">
</td>
</tr>
<tr >
<td> </td>
<td>
<INPUT TYPE=submit VALUE="Create Account">
</td>
</tr>
<tr >
<td align="right" colspan="2"> </td>
</tr>
</table>
</td>
</tr>
</form>
</table>
<p> </p>
____________________________
Shawn Mathews
shawn@oceanebi.com