# XSS, CSS Prevention

**URL:** <https://forum.kirupa.com/t/xss-css-prevention/248844>\
**Category:** programming\
**Created:** [January 12, 2008, 3:41am UTC](https://forum.kirupa.com/t/xss-css-prevention/248844 "2008-01-12T03:41:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishalraj9](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vishalraj9](https://forum.kirupa.com/u/vishalraj9)\
**Post date:** [January 12, 2008, 3:41am UTC](https://forum.kirupa.com/t/xss-css-prevention/248844/1 "2008-01-12T03:41:36Z")

</div>

Hi,  
I am trying to code a registration script in PHP & Iam even using preg\_match & strip\_tags, & other such security measures.Someone told me that I should filter metacharacters from user input. Iam using the preg\_match for that purpose so that I can disallow or reject unacceptable data. Iam only allowing only numbers, alphabets & space. But still this concerns me. Can anyone please tell me a proper way in the form of the code?

Thank you in advance.
