This is possible, Why don't you use MySQL and save the IP and check if it matches the clients current one to log them in?
That's a very bad idea, many players like me have dynamic ip. If the ip changes you lose your account? Besides that I can't figure out another way to match player with acount.