Does the shutdown occur when the battery is in the laptop? Right now, it sounds like there wiring is broken inside the enclosure of the charger (probably in the cord area). If the laptop is plugged into the outlet with the battery though, it shouldn't result in a shut down. If this is the case, then it may have to do with the laptop's PSU instead. That isn't a cheap fix if it is.
I tried a different charger that belongs to a friend of mine and it worked perfectly. So I think the problem was the charger itself. I bought a new charger this morning and it's working great now. But thanks for the follow up questions!