Using hidden field in PHP language

A hidden field is similar to a text field. The hidden field in a form are embedded in the HTML source code of the form. The difference is that the user cannot view the hidden field and its content. A hidden field enables the web developer to pass variables with values from one form to another without requiring to re-enter the information.

 

The Syntax to define a hidden field is as follows:

< INPUT TYPE = “HIDDEN” NAME=” hidden1” VALUE=” PHP MESSAGE” >

Where,

TYPE — specifies that the field is hidden

NAME — specifies the name of the hidden field

VALUE – specifies the value as it appears on the form

 

To use hidden fields and pass the name of the continents in a PHP script.

Steps are as follows:

 

<html>

<head>

<title>Hidden Field Page Title</title>

</head>

<body>

 

<form method=”GET” action=”content.php”>

Specifies the content:

<select type=”LISTBOX” NAME=”content”>

<option>ASIA</option>

<option>AUSTRALIA</option>

<option>EUROPE</option>

</select>   <br /> <br />

<input type=”hidden” name=”ASIA”>

<input type=”hidden” name=”AUSTRALIA”>

<input type=”hidden” name=”EUROPE”> <br />

<input type=”submit”>

</form>

</body>

</html>