Howto: create php popup login?

I want to create a php popup login, that authenticate username and password form a mysql database;
How do I go about it.
I am clueless.

As the page loads the login window pops up.
Something similar to this: