Quick AJAX / JSON security question
In a form I have I want to be able to check whether the i开发者_开发知识库ntended email address or username is unique as part of the validation process
I have created a JSON file with PHP from database data to work with JavaScript validation but the problem is that anybody can see the JSON file
Is there a way around this and still be able to use this method?
In short, no.
Why don't you just create an ajax function that takes in the email address and returns a boolean indicating whether it's unique by querying the database? JQuery has great AJAX capabilities: http://api.jquery.com/category/ajax/
精彩评论