I need to know the best method to prevent XSS issue in my website.
<form action="<?php echo htmlspecialchars($page)?>" method="post">
<input class="btn btn-default" type="submit" value="Continue">
</form>
The $page value is taken from the url :
www.xyz.com/redirect.php?page=home.php
The PHP code to get the $page value :
$page=$_GET['page'];
The link causing XSS:
www.xyz.com/redirect.php?page=javascript:alert(document.cookie)
Thanks