Jump to content
xisto Community
coldasice

[php] Hidden Fields?

Recommended Posts

Hidden fields are used for passing information in the same way as a non-hidden field. The difference with a hidden field is that the user never sees it. This means it always gets submitted with the default value, or a value set with some JavaScript.The main use for these is to confirm that a form was submitted using your form. A hidden field with a set value can be detected when a form is submitted with your script, but not if someone tried to inject values. They are also used to hold values set with JavaScript in some forms, and then to pass this data to PHP. For example, if you had a calendar in JavaScript and the user clicks a date, you could set the value of the hidden field to that date and therefore pass it to a PHP script.

Share this post


Link to post
Share on other sites

Hidden fields are used for passing information in the same way as a non-hidden field. The difference with a hidden field is that the user never sees it. This means it always gets submitted with the default value, or a value set with some JavaScript.
The main use for these is to confirm that a form was submitted using your form. A hidden field with a set value can be detected when a form is submitted with your script, but not if someone tried to inject values. They are also used to hold values set with JavaScript in some forms, and then to pass this data to PHP. For example, if you had a calendar in JavaScript and the user clicks a date, you could set the value of the hidden field to that date and therefore pass it to a PHP script.


thank you verry mutch.. i understand a little more :D but not enough :D

hm.. can i in a way make a hidden field in a login.. instead of using submit value.. i can use hidden field value :P?

Share this post


Link to post
Share on other sites

Yes, exactly correct. The 'hidden' value would not be visible to the User, but the receiving script would use it to confirm that the form and been submitted.w3schools.com has a good tutorial that may make it clearer for you.

Share this post


Link to post
Share on other sites

Yes, exactly correct. The 'hidden' value would not be visible to the User, but the receiving script would use it to confirm that the form and been submitted.w3schools.com has a good tutorial that may make it clearer for you.



welll thank you.. can u give me a link.. im surfing trough w3schools.. but i cant find it :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.