Posts: 27
Name: Leonard Bachman
Location: Mississippi, Usa
|
I love this topic, I will jump on Php security.
1. Use mysql_real_escape_string, NOT addslashes, to validate all user submitted data.
2. upgrade to php5. If you are still on php3, then get a new job.
3. Do not forget to use strip_tags to validate form data.
4. magic quotes, stop using them, in php6 they will be gone anyway.
5. When passing IDs in forms and links, verify the data wil (int) like this:
this makes converts the string to an integer... helps against attacks.
6. Use a function like this for validating data:
Quote:
function vdata($value) {
mysql_real_escape_string(htmlspecialchars(strip_ta gs(trim($value)));
return $value;
}
|
7. turn off indexes in .htaccess
8. Encrypt all passwords saved in files and databases with at least MD5().
9. Try not to chmod 777.
10. The list could never end, but I have to take a leak, so later gator.
Last edited by phpl33t : 07-21-2007 at 04:23 PM.
|