Results 1 to 5 of 5
Hybrid View
-
12th August 2009 10:58 #1
. - . , . "" . -. UTF-8, .
- .
Code:function utf8_substr($str,$from,$len) { if (mb_strlen($str) > $len) { return mb_substr($str,$from,$len,'utf-8'); } else { return $str; } } if (!isset($_POST['des'])) { header ("Location: http://www.evitatrade.com/"); exit; } $des = trim($_POST['des']); $des = str_replace("\t", " ", $des); $des = str_replace("\n", " ", $des); $des = str_replace("\r", " ", $des); if (empty($des)) { header ("Location: http://www.evitatrade.com/"); exit; } $des = utf8_substr($des, 0, 1200); if (!preg_match("#^[\s\-_,.!?)(0-9A-Za-z--]+$#u", $des)) // !preg_match( "#^[- _0-9a-z-]+$#i", !ereg("^[- _,.!0-9A-Za-z--]+$", { header ("Location: http://www.evitatrade.com/"); exit; }
-
12th August 2009 11:11 #2
- " "?
:
evitatrade.com/index.php?a=adds&b=index
:
.. , , SQL ( ).Code:$des = strip_tags($des); $des = addslashes($des);
.
...
PS - $_POST['des'], , , .Last edited by BornToDrink; 12th August 2009 at 11:16.
Hey, mother, I come bearing a gift. I'll give you a hint. It's in my diaper and it's not a toaster.
.
-
12th August 2009 15:22 #3
-
12th August 2009 15:42 #4
, - preg_match(). , . (.. ), .
stripslashes() -.
private static function _remove_magic_quotes($s) {
if (get_magic_quotes_gpc()) return stripslashes($s);
return $s;
}
addslashes (- mysql_real_escape_string()) . .
UTF8, , , , .
-
22nd August 2009 00:16 #5




Reply With Quote

LOG
6th May 2023, 12:03 in