>Also does anyone have suggestions on books for this type of subject?
i can recommend a book published by o'reilly (who else?) about basic secure coding-prinicples.
Secure Coding: Principles & Practices. it tells you a lot about what causes security wholes and how you can prevent them. but it does not show you specific code (that's why it's called 'principles').
have fun!