IPhone will not switch on or even function?

My charger switched off my iPhone and now my phone will not switch on unless connected to the charger.

But, I can't access Wi-Fi or my sim and the date and time resets. It does not connect to iTunes and freezes after five minutes. It will not recognise sound and if I take it off the charger, it immediately switches off. I've installed iOS8 previously but nothing is working.

It sounds like the ios 8 update did not install properly or some part is corrupted.

Try a factory reset through the setup app, while it's connected to the charger.

You could also try to do a "restore" through itunes.

Try holding power and home for quite a while, then turn it off again if it powers up.
Leave it a minute or two to make sure it has fully shut down.

Then, hold just Home and after a couple of seconds connect the computer USB cable.
That *should* force it into recovery mode, even with a corrupt IOS install.

See below for more info.

http://support.apple.com/.../kb/ht1808