Headphones/earbuds will not connect to phone

So i have been having this problem for a while now with my galaxy s2 where when i put my headphone/earbud jack into the reciver (hole for audio via headphones/earbuds) it will not connect to my phone and if it does it goes away easily. The problem is not the headphones/earbuds as they work on other devices/phones that also have the 3.5mm reciver. I have had it cleaned and that did not work. Any suggestions to how i could fix or improve this situation without being forced to buy a new phone?