Question:
Can anybody explain about the concept of hidden variables in php?
anonymous
2008-06-11 22:52:41 UTC
Can anybody explain about the concept of hidden variables in php?
Three answers:
Grant P
2008-06-14 20:58:04 UTC
Hidden variables are actually part of HTML. They (usually?) lie within an HTML "form". Because form fields are passed in the PHP-defined array, $_POST, when the form is submitted, they give you a way to pass more data/arguments than just user-entered form data.



A common way to use a hidden form field might be to set both a visible text field and hidden form field to the same initial value, say from a DB query. Then, when the form is submitted, server-side PHP can compare $_POST['visible_form_field'] to $_POST['hidden_form_field'] and know on the server, whether the value was changed by the user before submitting.



A hidden form field might also be set, when the form is built on the server (before being sent to the browser) with some limit value that client-side javascript could use (by referencing the document model) to validate user input within the browser.
?
2016-10-17 04:19:03 UTC
you may no longer "hide" the consultation variables. The person isn't waiting to be certain them until you echo, var_dump, or teach them etc. i might verify all consultation variables until now permitting something to flow on (for share internet hosting it fairly is a ought to). $_SESSION is a great international and continuously would be there despite the fact that if the array is empty. in case you such as you may set up a "consultation" style device with a database and use that quite of the $_SESSION or $_COOKIE.
Rams
2008-06-12 00:20:34 UTC
hidden variable used pass values when submits the form.

These are usefull when we want to pass kknow values to next page stores in hidden form element

see for more.



http://www.daniweb.com/forums/thread111341.html


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...