Dropped my iphone 5 into the toilet?

Okay so I dropped my iPhone 5 into the toilet and grabbed it out like 2 seconds later. I started patting it with a towel then took the case off quickly and the screen cover and kept patting it with a towel. Everything seemed fine but there were green lines all over the screen. I then put it in a bag of rice and left it there from about 5:30 p.m. To 10 this morning. I took it out and it was dead so I plugged it in and waited for it to turn on. When I turned it on the green lines were gone! But then it turned off and back on. It was still fine though. Then the apple sign came up and a ton of codes popped up above the apple sign. Now it just keeps acting like its turning on and off but never does it just goes back to the codes above the apple. Just as I was typing this I found a super tiny gash thing in the back at the top corner opposite of the camera. I can't afford to buy another phone my contract isn't up for another year.

Added (1). If you have any idea how to fix it please help everything Is on that phone I need it!

Go to a apple service center and get your phone repaired as soon as possible! And ya next time don't take your phone to **** in toilet.better get an mobile insurance next time! :-P

You could bring it to the Apple store and get a repair estimate. Might be cheaper than buying a new phone. Or, if all else fails, get a used iPhone 5 or 4S if it's not worth repairing your current iPhone 5.

It sounds like you did all the right things to minimize damage, such as the bag of rice, etc., so it might have just been bad luck that enough damage was done.

Depending on which carrier you're with, you could also get a new unlocked phone for just $349-399, i.e., the Google Nexus 5.It'll work on AT&T, T-Mobile, and Sprint, but not Verizon. Here's a link:
https://play.google.com/...16gb&hl=en

Hope that helps, and good luck!

Put it back in the bag of rice and leave it there for a few days, or leave it somewhere where it will get warm but not hot, like wrapped in a heating pad.
Leave it standing so the plug hole is at the top, so any water vapor can rise and have a way to escape.

The water must have fried some internal circuit. What you are getting is commonly called a boot failure where the phones fails to reach the homescreen and shuts off during startup.
there's no software issue on it thats certain, as water only affects hardware. Try putting it in the sun for a couple of hours…
otherwise take it to apples repair shop. You probably won't get any warranty as dropping in water is not usually covered.
i don't know what you mean by contracts as we don't have anything of the sort here in india but if this phone isn't repairable then try getting a used model or a cheaper phone.

as for that gash on the camera, its only a scratch and won't affect the phone. Can happen to any phone if it falls hard.

What you can do is contact your apple store and get it fixed.

You could bring it to the Apple store and get a repair