How to program a basic but secure login system using PHP and MySQL

How to program a basic but secure login system using PHP and MySQL