954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

email=username in_form

hi,

I have started programming (learning) to free myself from depencies.I do not know how to do the below.

i made a form that has a input box for emai and two passord inputboxexs.on submit i have to pass the same email inputbox value as the hidden value for username.In brief the username and the email should be same in the database.the database fileds are username,email,password. I request the members to help me how to do this.
this i tried but there is some error.

Hope someone would help me with this
Wishing you all a nice day

Harish

hbmarar
Junior Poster
190 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

You'll need to explain your problem more clearly. I have a hard time understanding what you are trying to accomplish.

Gary King
PHP/vBulletin Guru
Team Colleague
417 posts since Nov 2003
Reputation Points: 53
Solved Threads: 5
 

Hi Harish,

To assign the value of the email field to the username field, you would have to use javascript.

It would be something like:

(i havent tested the js)

(you will have to change formname to the name of your form.)

However...
You do not need to have the hidden field for the username. If it is the same as the email, then on the php script that handles the form, you can just use the email as if its the username.

In reality however, you really dont need to have a username field in your database, if it is the same as the email address. It is only redundant and takes up more space in your database... One of the good rules of creating a database is to remove redundancy, yet at the same time keep every row in the database unique. This is already achieved by a unique email address. It is still better even if you have an id for each row, that auto increments.

cheers...

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You