Not knowing what happened to the phone I'm just going to take a shot at it anyway. If you replaced the charger port and the battery only to find the phone is still not charging; The next thing I would do is replace the IC that controls that. If you look near where the charger port connects to the logic board, there is a little black square IC chip. That is the charging IC. If the phone was dropped, or dropped in water this chip or any other chip could go out. Its not that uncommon.
A little more history on what happened to the phone would help. If you want to see the part I'm talking about Google "iPhone charger IC" and you can see some pics. Like I said some more history on what happened would really help.