channark wrote:1- does filter sanitize and validate replace spliteslashes and mysql_real_escape_string or i should use all of them for more security ?
There is no built-in PHP function called 'spliteslashes' so I have no idea what that function might do.
As for replacing mysql_real_escape_string(), that would highly depend upon how you're using the filter extension with your strings. The answer is most likely no, there is no one-size-fits-all replacement for properly sanitizing data.
channark wrote:when i try to practice i use options min_range & max_range in VALIDATE_INT it doesn't works
That's because you used 'option' as the array index when it should instead be 'options'.
channark wrote:for sanitize when i put a url or email and i put a special caracters into it doesn't sanitized
Works fine for me:
echo "http://www.gôooglée.com/ => " . filter_var("http://www.gôooglée.com/", FILTER_SANITIZE_URL);
// output: http://www.gôooglée.com/ => http://www.google.com/
echo "brad@gôooglée.com => " . filter_var("brad@gôooglée.com", FILTER_SANITIZE_EMAIL);
// output: brad@gôooglée.com => brad@google.com
channark wrote:3- what is the best way used in forms because i found lot of examples and lot of ways, can some one give a simple php secure code
I don't know that there is a single "best" way for every form out there. You have to know what type of data you're expecting and how to validate/sanitize it. If there was an easy, one-size-fits-all solution then things like SQL injection attacks wouldn't exist.
channark wrote:i use md5...
...which is quite broken by now (heck, even SHA-1 ain't as strong as it used to be either). Hopefully you use a salt as well? Perhaps even one that is unique for each user?
channark wrote:...splitslashes...
Perhaps this is a variation on the function you referred to in the beginning of your post? Still, "splitslashes" isn't a built-in PHP function so that doesn't really tell us anything.
channark wrote:...real_escape_strings
Again, no such function. Perhaps you meant mysql_real_escape_string()? If so, note that it's only useful for sanitizing strings (hence the '_string' in the very name of the function) and not for numeric data.