Register works how would i do a login?

Below are the files that omega gave me to do registering.

Now that I understand how to do the register to database, I want to know how I would make a login?

I know its probably by sending the username and pass to the .php file and having it somehow load from the database and checking each one with the username and pass that was sent.

//edit, okay if someone know the code in php to check it or has it from another project that will work fine too. i think i can figure out how to get variables from a .php with flash.

Thanks feel free to IM me.