You seem to describe two (possibly related) issues: not charging and poor battery performance.
These are both extensively discussed here:
In a number of cases this is linked to a bloated battery. If you notice that your battery is expanding in the middle, or is otherwise deformed, shut down your phone and remove the battery immediately and then continue following instructions here.