To protect yourself from XSS cross site scripting . There are may techniques you can get from the Google search engine. There is an another way in which you can block the "<" in the user input so that no one can run the script. You can also filter add a filter or a escape character for the same"<" This will block the