black1101
 Užívateľ
 Založený: 31.05.2010 Príspevky: 26
 | Zaslal: Ne 11.12.11 22:12 |   |
Zdravím vás. Vedeli by ste mi poradiť, resp vysvetliť rozdiel prípadne popis nasledovných funkcií? Je to z PHP-F a o Php-f už niečo to svoje viem a chcel by som spraviť nejaký modifikácie no chcel by som presne vedieť ako sa majú správne používať tieto funkcie:
| kód: |
// Strip Input Function, prevents HTML in unwanted places
function stripinput($text) {
if (QUOTES_GPC) $text = stripslashes($text);
$search = array("&", "\"", "'", "\\", '\"', "\'", "<", ">", " ");
$replace = array("&", """, "'", "\", """, "'", "<", ">", " ");
$text = str_replace($search, $replace, $text);
return $text;
}
// stripslash function, only stripslashes if magic_quotes_gpc is on
function stripslash($text) {
if (QUOTES_GPC) { $text = stripslashes($text); }
return $text;
}
// stripslash function, add correct number of slashes depending on quotes_gpc
function addslash($text) {
if (!QUOTES_GPC) {
$text = addslashes(addslashes($text));
} else {
$text = addslashes($text);
}
return $text;
}
// htmlentities is too agressive so we use this function
function phpentities($text) {
$search = array("&", "\"", "'", "\\", "<", ">");
$replace = array("&", """, "'", "\", "<", ">");
$text = str_replace($search, $replace, $text);
return $text;
} |
ide mi hlavne o tú stripinput, stripslash a addslash. ďakujem vám vopred. |
| |
shaggy
 Moderátor
 Založený: 21.02.2006 Príspevky: 4627 Bydlisko: Bratislava
 |
1. čo je to PHP-F?
2. dokumentácia k tomu nefunguje?
3. čo chceš od nás počuť? Kód vieš čítať rovnako, ako my, nie? |
_________________ Neradím a nekomunikujem cez SS, ak niečo potrebujete, máte iné možnosti: Ak vám zmizla téma, alebo sa vám niečo nepáči. Ak potrebujete nahlásiť príspevok/človeka, reportujte ho. Ak máte s niečim problém, riešte to v danej téme. | |