Whether you're suffering from the dark economic climate, switching to a different phone (a mistake), or getting ready for a new iPhone (which is still unconfirmed), selling your iPhone makes you vulnerable to giving away private information. There have been many reports of individuals (with a good deal of programming expertise) being able to access all information the iPhone's previous owner thought he deleted.
Here's how you wipe out all private data for good:
1. Restore the iPhone through iTunes
2. Click on "Info" tab
3. Un-check all options (so you do not synchronize calendar, email, bookmarks, and contacts)
4. Go to Photos Tab, Podcasts Tab, and Videos Tab
5. In each one, uncheck "Sync"
6. Create 3 big playlists as large as the storage capacity of your iPhone
7. Go to "Music" tab
8. Select the first of the 3 playlists you just created to sync
9. Make sure the storage bar at the bottom is full
10. Sync your iPhone, change to the next playlist, sync again
11. Repeat for the 3rd playlist
This iPhone hack overwrites all the free space on your iPhone hence preventing any personal data from being recovered by the new owner.