How to prevent automatic iPhone sync when connected to computer?

Sometimes I just need to charge my phone from my laptop, and when iTunes and iPhoto open automatically and try transferring photos and syncing music and all that, it tends to crash the other programs I have open.

Any help is much appreciated, thank you!

You ca nopen the iTunes page without your phone connected, and then select the option to automatically sync when connected.