Secure way to store passwords
This is absolutely insecure.

I will list only a handful of things which I think need to be absolutely rewritten.


Do not use crypt. Instead, please use password_hash. Along with password_verify, your code could be simplified a great deal.
If you're going to use PDO, use it. Do not mix in other database access modules (MySQL). Especially not MySQL, it is not current and is not supported nor will it ever be supported in the future. mysql_real_escape_string gives a false sense of protection, but in reality, it does nothing for you.
Along with number 2, comes the possibility of SQL injection in your app. If you follow what I've said in number 2 (Use PDO (bind parameters, prepare statements), get rid of anything MySQL), you should be good.
If you're going to try something, catch it! I want to know when something goes wrong.