Cannot log on: black screen/login screen loop

view story

http://askubuntu.com – I have been using Ubuntu 12.04 for a few months now, but have now come across a problem that I can't get past. I am stuck at the log on screen: I enter my password but a black screen flashes up and the log on prompt reappears. I tried using the terminal and I actually have managed to login- but not using the main log on screen. I can't get my desktop active as the log on prompt is there. When I input a wrong password I get an invalid password message- with the correct password, the log on screen just reappears. (HowTos)