For a small project, 50% upfront and 50% net 10. (net 10 = delivery + 10 days)
Some people do net 30, but this fucks up your cashflow. Do net 10.
For a larger project, break it into milestones, and get the cash at net 10 for every milestone.
If the person doesn't pay, you stop working.
You also need a brief contract at the beginning of the project that says they don't get to use the work unless they pay for the full project. That way, if they use your work without paying, you can sue them.
p.s. stop working with asshole clients. They make you miserable. 90% of the hassle for 10% of the clients. If the person doesn't trust you enough to give you 50% upfront, then they are not a good client.
Yo mate!! That's some tough words

. All these days I was thinking of a possible solution and i seriously believe that upfront payment is the only solution. Though there are some hitches but we have to deal with them.
"Starting work without a contract is like putting a condom on after taking a home pregnancy test" -Mike Monteiro of Mule Design in his talk, Fuck you, Pay Me
Watch this video, like right now:
http://vimeo.com/22053820
If a client asks why you want partial upfront payment, you explain that you need operating capital and it messes up your cashflow otherwise.
PM me for more details or reply on this thread.