[Sprint Samsung Galaxy S III] porshce2:
I had the same issue as you, the phone will turn on and then most of the time it will turn off during the boot process. If I turn it on in Download or Recovery mode it'll stay on for a couple seconds and then turn off. At best, it'll turn on, get to the home screen and then after a couple seconds of usage it'll turn right back off. Also, did you notice that before the phone turned off it would lock itself and unlock itself possibly showing the power menu to like reboot or turn off and such? That made me think it might've been the power button but I'm not positive.

I could not get a fix for this at all, I attempted everything I could think of. I ran the phone in safe mode, it still did it. I ran a different rom, still had the issue. Ran stock rooted, same problem. Ran stock non-rooted, problem still there. In fact, I talked to Samsung yesterday and I sent it in for the warranty as I didn't have carrier insurance. One thing happened was that while I was in stock rooted, I decided to underclock the phone to see if anything would occur and I noticed something interesting. The phone still had the problem but it would stay on for longer periods of time. This made me think maybe the phone was overheating or the CPU was shutting itself off for some reason. As far as I know from my testing I can say that the problem was hardware related. I should also note that this thing happened to me once a couple months ago but I flashed the stock tar through Odin and the problem disappeared for a short while but it came back and continually did so.

Oh, I also figured out how to get it on for a short period of time. To get it to work temporarily, first make sure the phone is charged a good amount. Plug it in for a couple hours. Next, take the battery out of the phone for a couple hours and remove the phone from the charger, the longer you keep the battery out the better. Now, put the battery back in, and attempt to turn on the phone, if it doesn't work try again a couple times. The phone should eventually turn on and stay on for a short period of time (anywhere between 1 or 2 min and 30 minutes). From here just back up anything you need to and if you are rooted and want to turn it in for warranty or whatnot you'll need to clear the evidence that the phone was rooted.

First off, if you are rooted you'll want to clear your flash counter. Download the Triangle Away apk and put it in the microSD so you can access it easily when the phone turns on. Follow the instructions on how to turn the phone on from above. After it turns on, quickly Run Triangle away and click on the option that says something along the lines of "reset flash counter". Once that is done, turn off the phone and take out the battery so that you can turn it on for the next step.

Next, you will need to download Odin (I believe it is Windows only, if you don't have Windows I'm not sure what you can do as I haven't had to unroot on anything other than my PC) and the stock tar file so that you can return the phone to complete stock. Once you have done this, run Odin and click on the PDA tab and browse for the stock tar. Let Odin do it's thing and once you see it's ready to flash the file, put the battery back in and turn the phone back on in download mode. Plug the phone in and let it sit there for a couple seconds to make sure it won't turn off during the flashing process. If it does turn off try again. When you can get it to stay on for over 30 seconds click on the Start in Odin and start the flash. If it stays on for a while but turns off while flashing, the boot will be corrupt and you will have to try again til you can get it to stay on long enough. Note that if the boot is corrupt you won't be able to turn the phone on to anything other than Download mode and possibly recovery. Once you complete the flashing process the phone should auto-boot and it SHOULD work. That means that the phone should turn on with no problems but it may or may not turn itself off. If it doesn't turn itself off go ahead and use it for a while, but if your situation is like mine the problem will come back eventually. But at least now you can turn it in to Samsung for warranty or whatnot.

And if worst comes to worst you can completely f up the phone while it's flashing in Odin, have a corrupt boot img and then call in saying it doesn't work. ;)

Of course all of this is only if you're having a similar problem to me. Like I said, I sent it in yesterday so I'll post updates as I get them. Hopefully they'll fix it for me!