Sex pain

So my husband and i had sex and immediately after, i got really bad cramps and a harsh pain in my rectum, i couldnt pass gas bc it hurt too much and i am so uncomfortable, cramping a lot. Im still about 3 weeks from my pd, and i get extremely painful and heavy periods all the time. This pain kinda felt like those cramps but more concentrated near my anus.. anybody experience the same thing?