Chosen Solution

I replaced battery but my iphone not charging and rebooting continuously when connected to cable Restore tried by iTunes but I get error 3014 and 21 What is the matter?

Alwafi, You probably installed a defective new battery. Try a new KNOWN GOOD battery. If not, you damaged your battery connector on the board, or something around it. Examine it with a good magnifying glass like 10x or more, and let us know if you see anything damaged/missing/part broken.