<?php
if
(isset(
$_POST
[
'name'
])){
$str
= trim(
$_POST
[
'name'
]);
$str
=
strip_tags
(
$str
);
$str
= htmlspecialchars(
$str
);
$str
=
addslashes
(
$str
);
echo
$str
;
}
?>
<form method=
"post"
action=
""
>
<input name=
"name"
type=
"text"
>
<input type=
"submit"
value=
"提交"
>
</form>