I am printing directly form the url like
if(isset($_GET['name']){
echo $_GET['name'])
}
but my friend told me that its bad and vulnerable to XSS now how is it bad and what should i do to prevent XSS?
I am printing directly form the url like
if(isset($_GET['name']){
echo $_GET['name'])
}
but my friend told me that its bad and vulnerable to XSS now how is it bad and what should i do to prevent XSS?
just wrap content that should not contain tags in htmlspecialchars
echo htmlspecialchars($_GET["name"]);