My server has magic_quotes on and my code had add_slashes which I have removed. Now values get added in database properly. But there is a small problem. When filling up the form, if javascript is disabled and there is an error validating the form inputs(i.e. if any input is empty or wrong), any form input having the ' or " become /' or /" and remains as it is. Now when the form is finally submitted it goes with the /' or /" instead of simply ' or " and gets stored in the database in the same way which is what I don't want. What is it that I am doing wrong or missing??