Infection

I have been having pain during sex and a white secretion, could it be an infection? Is there a pill I can take without going to a gynocologist?