Can someone help me adding the htmlspecialchars to prevent XSS in this code:
<?PHP
if(isset($_POST['update'])) {
$ts=$_POST['ts'];
$user=$_POST['user'];
mysql_query("UPDATE users SET block_newfriends='". mysql_real_escape_string($ts). "' WHERE username='" .mysql_real_escape_string($user) . "'");
echo '<div class="rounded-container">';
echo '<div class="rounded-green rounded-done">';
echo '<b>reload</b><br>';
echo '</div>';
echo '</div>';
}
?>
I don't know where to put them, it should be in the POST function right?