Firstly, you're not cleaning those incoming POST variables with mysql_real_escape_string().
Secondly, have you thought about hashing your passwords so that they don't get stored as plaintext (md5, sha1 etc)?
Thirdly, have you made sure that two accounts can't have the same login combination? That can be done by not allowing email addresses that are already registered or by requiring the user to verify his/her email address before loggin in. Two or more accounts having the same login on your system would cause all of those accounts to get "locked out".
Fourthly, you should be checking for errors in your queries by doing this:
$obtainlogin=mysql_query("SELECT * FROM networks WHERE username='$user' && password='$pass'") or trigger_error(mysql_error());