That could be a number of things - water damage, a bad charger, a bad cable, a bad charging port. It has to go to a repair shop for a diagnosis. What you could try first, though, is leaving it on the charger, without trying to turn it on, for about 4 hours. (That depends on exactly what "keeps switching on then off" means - it keeps turning itself on and off, or you plug it in, turn it on and it turns off? If the latter, the battery is totally discharged, and 4 hours of charging before trying to turn it on should get it up to full charge.)