Iphone 5 keeps displaying lines on screen before shutting off and rebooting?

This morning when I woke up, I noticed my phone didn't charge over night so when I tried to figure out what happened, my phone kept shutting down. It does this every 2-10 minutes and I don't know what to do. Does anyone know how to fix this at home? Like could I erase everything and restore? Would that help? This is really frustrating because I can barely use my phone.

First I would check, if it actually charges. You that at the teeny tiny flash in the upper left corner. If there's none, the charger might be unplugged or loose, or you have a broken or dirty charging cable or plug.

  • Wi-Fi keeps shutting off automatically on iPhone? I recently purchased an iPhone 4S and ever since I connected it to my Wi-Fi home network it has been disconnecting off of the Wi-Fi and using my 3G. The Wi-Fi works great on my other devices, and I have to keep manually going to settings to connect it. Please tell me what to do to fix this issue and let it stay on the network until I manually disconnect it. 10 POINTS for the correct answer
  • My iphone keeps shutting off? I have an iphone 3g. The only way it will stay on if its on the charger or if its off the charger it must be playing music to stay on, but as soon as the music stops playing it will turn itself off and then start blinking the apple. The apple will come up and then go away and then come back. This just started happening lastnight, how can i fix it?
  • My Iphone keeps shutting off, but before it shuts off, my screen freezes and there's these lines that show up, they're random? My Iphone keeps shutting off, but before it shuts off, my screen freezes and there's these lines that show up, they're random. Sometimes there's this crackling sound, and sometimes the line move, my mom says its just the phone, but my dad says, its the proccecor and that its overheated, i have an Iphone SE rose gold 64 gb and my iOS is 12.3.1
  • My Iphone keeps shutting off? - 1 I have a Iphone 4 that is jailbroken, i bought it like this. About 2 months ago it just shut off on me and would only work on the charger a couple days after that it wouldnt work at all, i took it into apple and they tested the battery and it was good. A few days after that it shut off again and now won't work at all. Any ideas how to fix it or what's wrong with it