The
data is put into the database and taken out to display when the page needs to be noticed
warehousing
$str =addslashes ($STR);
$sql = INSERT INTO ' tab ' (' Content ') VALUES (' $str ');
When out of the library
$str =stripslashes ($STR);
Show when
$str =htmlspecialchars (NL2BR ($STR));
;?
//--headings, names, and other fields to be processed (go to head and tail space)
Functiontrans_string_trim ($str) {
$str =trim ($str);
$str = Eregi_replace ("'", "" ", $str);
$str =stripslashes ($STR);
Return$str;
}
//--article warehousing processing, that is, textarea field;
functiontrans_string ($str) {
$str =eregi_replace ("'", "" ", $STR);
$str =stripslashes ($STR);
Return$str;
}
//--is displayed in the form from the library; in text, trans, in textarea, no conversion, direct display
//--displayed on the Web page, filtering HTML code, including link address
Functiontrans ($string) {
$string =htmlspecialchars ($string),
$string =ereg_replace (CHR), <br > ", $string);
$string =ereg_replace (CHR), "", $string);
Return$string;
}
//--is displayed on a Web page and does not filter Html code;
Functiontrans_web ($string) {
$string =ereg_replace (CHR), <br>, $string);
$ String=ereg_replace (CHR), "", $string);
Return$string;
}
//--is displayed on a Web page, filtering HTML code and leading and trailing spaces, mainly for displaying user nicknames
Functiontrans_trim ($string) {
$string = Trim ($string);
$string =htmlspecialchars ($string);
$string =ereg_replace (CHR), "<br>", $string);
$string =ereg_replace (CHR), "", $string);
Return$string;
}
//--is displayed in span;
Functiontrans_span ($string) {
$string =ereg_replace (CHR), "N", $ string);
$string =ereg_replace (CHR), "", $string);
$string =ereg_replace (' "," "", $string);
Return$string;
}
//--displays cookies on the web, filtering HTML
Functiontrans_cookie ($str) {
$str =trans ($str);
$str =stripslashes ($STR);
$str =eregi_replace ("" "," "", $str);
Return$str;
}