My site has many places where users input data through form fields. I am trying to make a PHP check input fuction
that will properly edit the data string and return the proper value or return an error.
I have this for the password check already, I only allow alpha numeric:
Code: Select all
if (!ereg ('[0-9A-Za-z]', $newpass1)) { dump('passbadchar'); } else { IT IS GOODjava, php, html, etc. I am storing this in a mysql field.
My function works like,
Code: Select all
$result = $checkinput($string, $type);where i got string from,
Code: Select all
$string = $_POST['whatever']I have the code already for password and for email, but the code for pulling out the embedded code is what
I am having some problems with. Someone also suggested that maybe I should allow html but no other type
of code, but I think that might be even harder to code.
Thanks in advance for any suggestions. my php is not so strong so I am glad I found this site, with a lot of
very skilled ninja coders here.
Jason