I'm using PHP. I'm attempting to prevent some XSS on my page. One test I'm running has this in the url params:
www.mypage.com?error=<script>alert(11170579)</script>&foo=one&bar=two
The errorr=...
param is not coming from a form input. It's just inserted into the url.
How can I use Javascript to escape/decode the tags so the alert() does not execute? I did find a couple of examples of parsing the param values in the url, but none mentioned how to prevent or change the code so it did not run.
Thanks for any help.