Do i need a new battery for my Iphone?

When I plug it in it boots up and it runs for 5 seconds then a spiral thing shows up in the middle of the phone and it shuts off before I can type in my code. This happens right when I plug it in. The phone won't even work when it is plugged in and it just shoes the battery with the energy symbol under it. I had it plugged in all night and still showed the same thing so i'm thinking i need a new battery.

Added (1). I should add that it is an iphone 4

Well you can't replace the battery so your only option is to get a whole new phone

Yeah if its over 3 years old