issues using htmlspecialchars($_POST['']) to keep data on value after submitting

139 Views Asked by At

I am using htmlspecialchars($_POST['']) to keep the data submitted with errors on my registration form,

<form method="post" action="<?php echo htmlspecialchars( $_SERVER['PHP_SELF']) ;?> ">
    <div>Company</div>
    <input type="text" name="user_account" size="20"
        value="<?php echo htmlspecialchars($_POST['user_account']); ?>" 
        placeholder="Company Name">
    <input type="submit" name="submit" value="submit">
</form>

but before the page is submitted, I am getting unknown data where I am using the value="<?php echo htmlspecialchars($_POST['user_account']).

How can I solve this problem?

0

There are 0 best solutions below