HI,
My wife's Galaxy S2 was behaving exactly as you describe. It turned out to be a dirty USB port on the phone. I used a dry toothbrush to clean the port. I also cleaned the cable end as well. Now the phone charges and works normally. I hope you got your's fixed. Cheers!:)