Hmmm...let's see...you're "programming in php," but you can't figure out how to build a login script.
I'll give you some hints. You need a form for the user to fill in their credentials. You need to send the data to the server and compare it to the user's account information, which means "database".
As for the button changing, that's basic HTML.