Filltering
Collapse
X
-
don't be over smart always seen you many time and never use cheap word what ever at last it could help some time and some where easy way if you were said use htmlpurifier instead cheap got it ? i am not posting get here mod status even don't need your suggestion or any type argueLast edited by GiLL; 16.01.10, 07:37.
-
And if quote u u will. . .?
Oh pls, save ur **** talk. All im sayin is if u want to filter, do it ryt or dnt do it at all. Try htmlpurifier or gills. Ur choice. Gills simpler and easier to implement, and d other is harder. Your choice.
Leave a comment:
-
i wouldnt help any more your master then give him code and help him instead making nonsense comments mind it i dont care what ever you know or who are you and next time dont quote my postOriginally posted by mobileGIGS View Postjust use htmlpurifier instead of gills cheap attempt at data filteration.Last edited by GiLL; 15.01.10, 03:38.
Leave a comment:
-
just use htmlpurifier instead of gills cheap attempt at data filteration.
Leave a comment:
-
3 lettersOriginally posted by GiLL View Postput this in your confg.php or ini.php
PHP Code:function scharin($word) { $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; for($i=0;$i<strlen($word);$i++) { $ch = substr($word,$i,1); $nol = substr_count($chars,$ch); if($nol==0) { return true; } } return false; }
put this line in your register.php and you replace $login to your user name etc
andPHP Code:if(scharin($login) == true) $error=$error.'Invalid Characters in Nick!<br/>';
PHP Code:if(strlen($login)<3) $error=$error.'Nick should be Minimum of 3 words!<br/>';
if you need more and strong filter send me pm will tell you

just correcting
Leave a comment:
-
ok,
so you want to prevent mysql injection or filter special chars?
1. if you want to filter special chars use the first code ive posted,
2. if you want to prevent mysql injection use mysql_real_escape_string
3. if you want to filter chars and prevent mysql injection use both.
4. and if you only want to check username for special chars you can use this:
fershtein?PHP Code:if (preg_match("/[^\da-zA-Z-._]+/", $username)) $error .= 'Incorrect username! Please avoid spaces and special chars.';
Leave a comment:
-
Ok im using mysql_real_escape_string in XAMPP but the special characters are still going in the database
Leave a comment:
-
yeah but at last it can stop special characters and we can use mysql_real_escape_string also bad char function or lets useOriginally posted by GumSlone View Postthis is not a good solution to prevent mysql injection
PHP Code:if(!get_magic_quotes_gpc()) { $_GET = array_map('mysql_real_escape_string', $_GET); $_POST = array_map('mysql_real_escape_string', $_POST); $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE); } else { $_GET = array_map('stripslashes', $_GET); $_POST = array_map('stripslashes', $_POST); $_COOKIE = array_map('stripslashes', $_COOKIE); $_GET = array_map('mysql_real_escape_string', $_GET); $_POST = array_map('mysql_real_escape_string', $_POST); $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE); }
Leave a comment:
-
This thread is going to help alot of people who are new to Php I personally find filtering to be a pain.
Leave a comment:
-
It would be nice just be use
1234567890abcdefghijklmnopqrstuvwxyz
nothing else
Leave a comment:
-
this is not a good solution to prevent mysql injectionOriginally posted by GiLL View Postput this in your confg.php or ini.php
PHP Code:function scharin($word) { $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; for($i=0;$i<strlen($word);$i++) { $ch = substr($word,$i,1); $nol = substr_count($chars,$ch); if($nol==0) { return true; } } return false; }
put this line in your register.php and you replace $login to your user name etc
andPHP Code:if(scharin($login) == true) $error=$error.'Invalid Characters in Nick!<br/>';
PHP Code:if(strlen($login)<3) $error=$error.'Nick should be Minimum of 3 words!<br/>';
if you need more and strong filter send me pm will tell you
Leave a comment:
-
one other way
put this in your confg.php or ini.php
PHP Code:function scharin($word) { $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; for($i=0;$i<strlen($word);$i++) { $ch = substr($word,$i,1); $nol = substr_count($chars,$ch); if($nol==0) { return true; } } return false; }
put this line in your register.php and you replace $login to your user name etc
andPHP Code:if(scharin($login) == true) $error=$error.'Invalid Characters in Nick!<br/>';
PHP Code:if(strlen($login)<3) $error=$error.'Nick should be Minimum of 3 words!<br/>';
if you need more and strong filter send me pm will tell you
Last edited by GiLL; 09.01.10, 16:19.
Leave a comment:
Leave a comment: