Do I need a new iPhone 4 charger?

My phone isn't charging. Till yesterday it used to say This accessory is not supported when I touched the charger or moved my phone. But now it's not charging at all… I'm pretty sure it's the charger because the rubber thing is ripped at the end and you can see the wires from inside, and also my friend gave me her charger and it was charging. So it's the charger. But do I have to buy a new one? Because I need my phone, I don't really have time to buy a charger, since I live far from the city, and I can't just go whenever I want, and also I'm not in very good condition with my money… I don't have other chargers that can charge my iPhone, and I don't have any friends who live nearby to borrow their charger. So do I HAVE to buy a new one or is there any way that I can charge it differently?

There are many kinds of universal iPhone charger for sale. It is cheaper in some online store. You can buy a new charger.