The following functions can be used to filter user input to ensure that the input is XSS safe. For details on how to filter, you can refer to the inside of the function, which also has comments.
Copy code The code is as follows:
function RemoveXSS($val) { // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed // this prevents some character re-spacing such as