html - hidden field in php -
for hidden fields, can use field of type
<input type="hidden" name="field_name" value="<?php print $var; ?>"/>
and retrieve after / post method $_get['field_name'] / $_post['field_name'] ?
are there other ways of using hidden fields in php?
you absolutely can, use approach lot w/ both javascript , php.
field definition:
<input type="hidden" name="foo" value="<?php echo $var;?>" />
access w/ php:
$_get['foo'] or $_post['foo']
also: don't forget sanitize inputs if going database. feel free use routine: https://github.com/niczak/php-sanitize-post/blob/master/sanitize.php
cheers!
Comments
Post a Comment