Here's an article
with suggestions on what to do if you get your iPhone wet.
What to do if your iPhone gets wet
by Ben Wilson
Whether the culprit is a sink, toilet or rainstorm, getting your iPhone soaked in water or any other liquid is bad news. If the unthinkable happens, and you don't have insurance, your best bet is to make sure the iPhone is off, swap it down with a dry cloth, then do one of the following immediately:
Put your iPhone in a tub or bag of uncooked rice
and let it sit for several hours (up to 2 days).
Place your iPhone in a plastic bag with a few silica packets.
Put your iPhone in a hearing aid dryer for several hours.
The point with all of these methods is to draw all moisture out of the phone as quickly as possible. Just air-drying the unit is an option, but won't act as quickly as the aforementioned methods.
If none of these tactics prove effective, and your iPhone loses significant or all functionality, an Apple FAQ states that if you own an iPhone and it requires service for any reason other than the battery (which costs $86 total to replace), Apple will repair your iPhone for the service fee listed below, plus $6.95 for shipping and handling:
Presumably this includes liquid damage, though Apple states ?Service may not be available if your iPhone has been damaged due to accident or abuse.?
We've received reports from some readers who had success having their liquid-damaged iPhones replaced free of charge by geniuses at the Apple Store, but don't count on it. This type of replacement is likely only if it can be proven that the device was damaged during routine use.