You'll need a little more than that though, otherwise users may be able to access other users' pages. For example, you might want to start a session if the user successfully logs in, perhaps setting the user id as a session variable, and then check for this session and id in the user's page.
Oh, and it is good practice to use [man]die[/man] or [man]exit[/man] right after sending a location header. Also, you only need to SELECT COUNT(), not SELECT , to authenticate the user. However, I would rather use a hashed password, then SELECT pass_hash, pass_salt, and then compute the hash of the user supplied password and see if it matches the password stored.