I believe you can help me...
I need a code that can check user information.

user fillout the input field with his idnum. Once the user goes to the next field, information from mysql db will appear showing the name of the person. In that way, the idnum is validated that it matched the user.

How? Pls help.


What do you have so far, and what do you need help with ?

Thanks for the reply.
I only have an existing form and a database of users. My plan is, when the user input its id number, beside the input field will appear the user's name.

What do you think?

So, when the user leaves the ID input field, you want to automatically show the user's name beside the box ? You'll need some javascript/ajax knowledge and a php function to retrieve the correct data.

My php knowledge is good, same as mysql. My problem is, I only understand javascript code but cant create a code my self.Im a newbie when it comes to this...
can you show me some sample codes that I can refer to...


w3schools has javascript, jquery, ajax and json tutorials to get you started.

Member Avatar

Do you really want to do this?
you're giving away hidden info from the DB.
type in a random no. and you get the related username.
doesn't sound that sensible to me.

is there a good reason to do this?

If you must, you've got to use ajax (as mentioned), which should be posted to that forum.

Thanks for the reply ardav..
You replied a logical answer. You're right, the security is at risk if we will do that. Honestly, I will not really use it for user authentication. I just referred to that example because I thought my question will be understood well that way. The function of the code is similarly like that what I am asking...

Member Avatar

see Pritaeas' answer in that case.