I am using a hidden field in a form. The idea is to send a number of hidden fields to pass to a form with each individual room having its own id. The site is a hotel booking site. I have tried
<?php echo$id;?>
But this does not work in this instance. I have tried a number of different ways but with no luck. The code is as follows:
$query = "SELECT * FROM `rooms`";
$result = mysql_query($query) or die (mysql_error());
if (mysql_num_rows($result)>0){
while ($row = mysql_fetch_row($result)) {
$rid=$row[0];
$hid=$row[1];
$number=$row[2];
$description=$row[3];
$sleeps=$row[4];
$booking = '<form id="form1" name="form1" method="post" action="/form2.php">
<input name="id" type="hidden" id="id" value="$id" />
<input name="hid" type="hidden" id="hid" value="$hid" />';
$booking1 = '<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>';
echo "$booking";
echo"$number\n\n";
echo"$description\n\n";
echo"$sleeps\n\n";
echo "$booking1<br><br>";
}
}
All the rooms show but as i want to send a number of different information ie $id $hid etc.
I would be happy of any help Thank you.