My iphone suddenly stopped working and wont restore
I was sitting in school, when suddenly my iphone 6 turned off. I tried turning it on again, and it showed the apple logo on the white background for a few seconds, and then it shut down again. This happened alle the times that I tried. When I got home I tried plugging it into the charger on my computer, and it turned on, but the screen was black and I could only do emergency calls. I tried putting it in restore mode and restore it on my computer, but everytime I try, it like, plugs itself out again. I really need help here.
iPhone 6, iOS 8.1.2