IPhone 4 only charges when turned off?

My phone will not charge while it's on whatsoever. The lightning bolt symbol never shows. Only when I turn it off, it charges perfectly fine, but obviously since it's turned off I can't use it, and that's a problem. What could be wrong with my phone, and what should I do?

I have also iphone4 but it has no such problem but there's other type of problem

  • My new iphone 5 only charges when turned off? I have a new iphone 5 that I recently bought and is updated to ios 8 but the problem is it only charges when the phone is turned off, I have tried restarting my phone but nothing changes, and I have also cleaned out the lint from the phone but it made no difference
  • My iPhone turned off by itself and turned back on while using a app? When I was on YouTube my phone just shutted off by itself then turned on. Is there something wrong with the phone. Also when I click my home button one time the phone sometimes wouldnt come on till the second click. What can I do?
  • My iphone only charges after I turn it off and back on? When I plug my iphone in it won't charge so if I turn it off and plug it in the turn it back on it starts to charge and my battery is going dead really fast and help on how to fix
  • My Iphone 4s only charges when off? My iphone 4s only charges when its off. I held down the lock and home button to reset it but nothing works at all. I've done it for like 5 five tines in a row. Does anyone wanna know how to fix this?