Jump to content

Making the User Name an Email Address


Chrisj

Recommended Posts

I'm using script program with a Create Account Page. It asks for User Name, Password, Email Address etc., I want the User Name to be the Users Email Address, is there a way to combine these, so that the User Name is the email address?

 

Or is it possible to somehow require that the user enter an email address as a User Name?

And then store the user name where the email address would be stored?

 

Thank you.

 

Here is the code:

 

<?php global $account; ?>

<form method="POST" action="index.php">
<table align="center" cellpadding="1" width="70%" height="100%">
<tr><td> </td></tr>
<tr><td> </td></tr>
<input class='field' type='hidden' name='command' value='account'>
<input class='field' type='hidden' name='param' value='signup'>
<tr><td colspan='2' class='pageTitle'><div class='hLine'>Create new account</div></td></tr>
<tr><td> </td></tr>
<tr>
<td class='fieldLabel' width="30%">Membership type</td>
<td align="center">[account_type_panel]</td></tr>
<tr><td> </td></tr>
<tr>
<td class='fieldLabel' width="30%">User Name</td>
<td><input class='field' type='text' size='30' maxlength="30" name='user_name' value='<?=$account->user_name ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('user_name') ?></span></td>
</tr>
<tr>
<td class='fieldLabel'>Password</td>
<td><input class='field' type='password' size='30' maxlength="30" name='password' value='<?=$account->password ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('password') ?></span></td>
</tr>
<tr>
<td class='fieldLabel'>Re-enter Password</td>
<td><input class='field' type='password' size='30' maxlength="30" name='reenter_password' value='<?=$account->reenter_password ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('reenter_password') ?></span></td>
</tr>
<tr>
<td class='fieldLabel'>Name </td>
<td ><input class='field' type='text' size='40' maxlength="50" name='first_name' value='<?=$account->first_name ?>'>
<span class='requiredField'> *&nbsp</span><span class='errorMessage'><?=$account->get_error('first_name') ?></span></td>

</tr>
<tr>
<td class='fieldLabel'>business / company name</td>
<td><input class='field' type='text' size='40' maxlength="50" name='last_name' value='<?=$account->last_name ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('last_name') ?></span></td>
</tr>
<tr><td> </td></tr>
<tr>
<td class='fieldLabel'>Email address</td>
<td><input class='field' type='text' size='40' maxlength="50" name='email' value='<?=$account->email ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('email') ?></span></td>
</tr>
<tr>
<td class='fieldLabel'>Address</td>
<td><input class='field' type='text' size='40' maxlength="70" name='address' value='<?=$account->address ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('address') ?></span></td>
</tr>
<tr>
<td class='fieldLabel'>Address 2</td>
<td><input class='field' type='text' size='40' maxlength="70" name='address_second' value='<?=$account->address_second ?>'></td>

</tr>
<tr>
<td class='fieldLabel'>City</td>
<td><input class='field' type='text' size='40' maxlength="50" name='city' value='<?=$account->city ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('city') ?></span></td>
</tr>

<tr>
<td class='fieldLabel'>Zip/Postal code</td>
<td><input class='field' type='text' size='35' maxlength="35" name='zip_postal_code' value='<?=$account->zip_code ?>'>
<span class='requiredField'> * </span><span class='errorMessage'><?=$account->get_error('zip_code') ?></span></td>
</tr>
<tr>
<td class='fieldLabel'>Phone Number</td>
<td><input class='field' type='text' size='35' maxlength="35" name='phone' value='<?=$account->phone ?>'></td>
</tr>
<tr>
<td class='fieldLabel'>Mobile Phone Number</td>
<td><input class='field' type='text' size='35' maxlength="35" name='mobile_phone_number' value='<?=$account->mobile_phone_number ?>'></td>
</tr>
<tr><td> </td></tr>



<tr><td> </td></tr>
<tr><td colspan="2" class='hLine' align="right"> <span class='requiredField'> *</span>   Required field</td></tr>
<tr><td colspan='2' align="right"><input class='button' type='submit' value='create'></td></tr>
<tr><td colspan="2"> </td></tr>
</table>
</form>

     

 

Link to comment
https://forums.phpfreaks.com/topic/57893-making-the-user-name-an-email-address/
Share on other sites

I am not quite sure as to what you are asking, but usernames can be configured to be email addresses themselves.  For instance, you can require they login with their email and password, completely eliminating the email address.

 

Now, if that's not what you are looking for, are you trying to also create email accounts on your server for their username, or something else?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.