Hi Folks,

I am developing a form in HTML and it writes to MySQL database using PHP. I need to do the server side validation. How can I go about it ? Can anyone please give a sample example code.

Assume that the form accepts name and the city and on the server side (PHP) I want to check the MySQL if the record already exists, and if exists, I want to through the error message AND at the same time, I would like to keep contents of the name & the city on the form.

Is it possible to do it using AJAX ?

Please throw me some basic examples.

Thanks in advance,