Daria
09-25-2006, 12:00 PM
I am working on the form security (learning curve for me); understanding that there is no such thing as 100% secure input, I am reading on the subject.
Meanwhile, I am implemening some validation, to avoid (within reason) passing a script - see (example I used in the form passing variables to search mysql table below;
if( eregi('opendir', $search)) die("invalid characters!");
if( eregi('fwrite', $search)) die("invalid characters!");
if( eregi('fopen', $search)) die("invalid characters!");
if( eregi('fread', $search)) die("invalid characters!");
if (!eregi("^[a-zA-Z0-9]{0,64}$", $search)) die("too many characters!.");
(I have everything in separate lines for better visual reference for me);
How effective would things like these be?
Meanwhile, I am implemening some validation, to avoid (within reason) passing a script - see (example I used in the form passing variables to search mysql table below;
if( eregi('opendir', $search)) die("invalid characters!");
if( eregi('fwrite', $search)) die("invalid characters!");
if( eregi('fopen', $search)) die("invalid characters!");
if( eregi('fread', $search)) die("invalid characters!");
if (!eregi("^[a-zA-Z0-9]{0,64}$", $search)) die("too many characters!.");
(I have everything in separate lines for better visual reference for me);
How effective would things like these be?