dflow Posted June 5, 2011 Share Posted June 5, 2011 im building a login system what would be the best way to check for unique address using ajax? Quote Link to comment https://forums.phpfreaks.com/topic/238473-check-for-unique-email-address/ Share on other sites More sharing options...
ahmad.amin Posted June 5, 2011 Share Posted June 5, 2011 I'm assuming that all your email address and login information will be stored in a MySQL Database. You will need to do a MySQL SELECT query and count the number of rows returned. If the number of rows returned is greater than zero(0) then the inputted email address isn't unique. The ajax part isn't that important to checking if the email address is unique or not. You'll have to use PHP or some other programming language to do that part. JavaScript (Ajax is apart of) isn't allow to connect to the server and do request as such. Here is how it can work: You have a form with an input field for the email and then onblur="checkUniqueEmail();" you have JavaScript function that utilized XHR and make a request to some php file that makes database query that returned true of false. Quote Link to comment https://forums.phpfreaks.com/topic/238473-check-for-unique-email-address/#findComment-1225420 Share on other sites More sharing options...
dflow Posted June 5, 2011 Author Share Posted June 5, 2011 I'm assuming that all your email address and login information will be stored in a MySQL Database. You will need to do a MySQL SELECT query and count the number of rows returned. If the number of rows returned is greater than zero(0) then the inputted email address isn't unique. The ajax part isn't that important to checking if the email address is unique or not. You'll have to use PHP or some other programming language to do that part. JavaScript (Ajax is apart of) isn't allow to connect to the server and do request as such. Here is how it can work: You have a form with an input field for the email and then onblur="checkUniqueEmail();" you have JavaScript function that utilized XHR and make a request to some php file that makes database query that returned true of false. thanks more or less what i thought Quote Link to comment https://forums.phpfreaks.com/topic/238473-check-for-unique-email-address/#findComment-1225423 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.