functions.php 444 Bytes
Newer Older
Sorrel Harriet's avatar
Sorrel Harriet committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

/* 	Helper functions. 
	Include once from index.php */

/* define a function to sanitise user input 
(this would ideally be in includes folder)
helps protect against XSS */
function clean_input($data) {
  $data = trim($data); // strips unnecessary characters from beginning/end
  $data = stripslashes($data); // remove backslashes
  $data = htmlspecialchars($data); // replace special characters with HTML entities
  return $data;
}

?>