Username = Email address

Hi -

I recently implemented some open source code to develop a shopping cart system. As I am new to web development I ran into some hickups, one being that I would like the username of client to be equal to his email address and not give him the option to have it otherwise.

Curent Username ad email address fields are defined by:
[php]
$email = isset($_POST[‘email’]) ? prepare_input($_POST[‘email’]) : “”;

$user_name   = isset($_POST['user_name']) ? prepare_input($_POST['user_name']) : "";

field order is correct for updating username field after tabbing from email address, if this helps.
[/php]

Would appreciate some assistance.

Regards,

[php]$email = isset($_POST[‘email’]) ? prepare_input($_POST[‘email’]) : “”;

$user_name   = isset($_POST['email']) ? prepare_input($_POST['email']) : "";[/php]

In your form you could remove the username part of it and just set the $user_name as email. Since they will both equal the same anyhows.
[php] $user_name = isset($_POST[‘email’]) ? prepare_input($_POST[‘email’]) : “”;[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service