php | Wrap input value for security

To prevent misusing inputs for SQL injection

<?php echo isset($_POST['name']) ? htmlspecialchars($_POST['name'], ENT_QUOTES) : ''; ?>

You should wrap the output in htmlspecialchars() for security.

https://radu.link/keep-form-data-submit-refresh-php/

,

Leave a Reply

Your email address will not be published. Required fields are marked *