cannot occur with an intercourse just before the onset of a period as this is the safest period of the cycle. Your symptoms are suggestive of some vaginitis
and an associated urinary infection. You need a local examination by a specialist, get a vaginal and cervical swab and urinalysis
to ensure proper management. Spotting can happen due to infections of the pelvis and also due to hormonal
imbalances that can coexist. Treatment of the cause usually cures the spotting too. Please have adequate liquids, maintain genital hygiene and do not use any tampons; use sanitary pads instead. Please abstain from intercourse until you get complete relief. Your husband may also treatment. Hope this helps.