SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member
    Join Date
    Apr 2007
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making the User Name an Email Address

    I'm using 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?

    I'm not to familiar with code or values, but User Name shows:
    value='<?=$account->user_name ?>'>
    And the email address shows:
    value='<?=$account->email ?>'>

    Is there any way to combine these?

    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>&nbsp;</td></tr>
    <tr><td>&nbsp;</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>&nbsp;</td></tr>
    <tr>
    <td class='fieldLabel' width="30%">Membership type</td>
    <td align="center">[account_type_panel]</td></tr>
    <tr><td>&nbsp;</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'>&nbsp;*&nbsp;</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'>&nbsp;*&nbsp;</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'>&nbsp;*&nbsp;</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;*&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'>&nbsp;*&nbsp;</span><span class='errorMessage'><?=$account->get_error('last_name') ?></span></td>
    </tr>
    <tr><td>&nbsp;</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'>&nbsp;*&nbsp;</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'>&nbsp;*&nbsp;</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'>&nbsp;*&nbsp;</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'>&nbsp;*&nbsp;</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>&nbsp;</td></tr>



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

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The form is your least problem. Replacing username with e-mail is rather complicated operation. The authentication, session management, etc. relies on this information, changing it means changing the program itself. Your only hope is that the application is flexible enough for this, otherwise you've some sleepless nights on your schedule, I'm afraid.
    Saul

  3. #3
    SitePoint Evangelist optl's Avatar
    Join Date
    Oct 2004
    Location
    Washington DC
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you can find the function/method that creates a user, you could just replace $_POST[user_name] with $_POST[email] but as the poster above stated you will have to worry about authentication. My way is just a quick ugly fix.
    For the phrase "Bethesda home architect", my clients
    websites occupy 6 of the first 8 results
    on the 1st page of Google. My Secret SEO Strategy Revealed

  4. #4
    Non-Member
    Join Date
    Apr 2007
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hi

    Thanks for your replies.

    You stated "Replacing" username with e-mail is rather complicated operation.

    Rather than "replace" 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?


    Thanks
    Last edited by alex111; Jun 30, 2007 at 07:52.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •