Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo htmlentities($_POST[‘input’], ENT_QUOTES, ‘UTF-8’);
- array_walk($_POST, 'htmlentities');
- function h($s) { echo(htmlspecialchars($s)); }
- ...
- <?php h($POST['input']) ?>
- $_POST = clean_input($_POST);
- $_GET = clean_input($_GET);
- $_COOKIE = clean_input($_COOKIE);
- $_SESSION = clean_input($_SESSION);
- function clean_input($array){
- if(count($array)){
- foreach ($array as $key => $value) {
- $array[$key]=htmlentities($value, ENT_QUOTES, 'UTF-8');
- }
- }
- return $array;
- }
Add Comment
Please, Sign In to add comment