php - Xss when echoing direct from url -


this question has answer here:

i printing directly form url

if(isset($_get['name']){    echo $_get['name']) } 

but friend told me bad , vulnerable xss how bad , should prevent xss?

just wrap content should not contain tags in htmlspecialchars

echo htmlspecialchars($_get["name"]); 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

javascript - Chart.js - setting tooltip z-index -