painful sex

Sex has become so painful that it's putting me off having sex altogether, it doesn't seem to matter what position we're in it still really hurts.
We've even tried anal sex and that hurts even more- it feels like he's hitting something every time in moves. Now I feel that more with anal than with normal sex so it can't be the cervix I feel him hitting. What else cud it be. It gets to the point where I can't physically walk the pain is unbearable.