My iPhone won't charge unless it's turned off?

My phone won't charge unless it's turned off. I just bought this charger two days ago. Is there anyway I can fix this problem? It's not the chargers fault.

Start by looking in the instruction manual for the phone - they provide it for a reason!

Is it an official charger and not a cheap knockoff? It's quite possible it isn't producing enough power to charge the device while it is on