Reputation: 9
I have a simple input form from the type submit and it contains the value $username:
<form action="index.php" method="POST">
<input class="submit" type="submit" name="submitbtn" value="'.$username.'">
</form>
How can I hide the value, so that it will not be displayed on index.php, but I still can access this value?
Upvotes: 0
Views: 774
Reputation: 7143
To hide fields in form from displaying change their type to hidden
. Keep in mind that hidden
field is just not displayed but anyone can read it/change it with browser devtools.
<form action="index.php" method="POST">
<input type="hidden" name="user_name" value="'.$username.'">
<input class="submit" type="submit" name="submitbtn" value="Submit">
</form>
Upvotes: 1