Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - alternative to html hidden input

I need to resend a value from a previous html form in another form so that it can be used as part of a prepared SQL statement.

However, I do not really want to use html hidden input due to potential security problems.

Anyone know of another method?

Thanks.

like image 901
Daniel West Avatar asked Mar 02 '26 11:03

Daniel West


2 Answers

Temporarily save the values in a session.

Hidden HTML inputs shouldn't cause any security problems though, as long as you properly validate them (again) before putting them in the database.

like image 83
deceze Avatar answered Mar 05 '26 01:03

deceze


You can save it in the session, then the user would never see the value.

like image 31
cambraca Avatar answered Mar 05 '26 01:03

cambraca



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!