I have just started PHP and mySQL and need to know if this is \"safe\". The login information is passed into the following PHP file through AJAX (jQuery).
Also never tell user things like "user doesn't exist" or "incorrect password". It's much better if you just print out "Incorrect username or password" so everyone cannot check for existing usernames and then try to guess password for these.