Hi all,
Can any one help me in using hidden values with a form that posts to it self
the form has 2 fields one of them is selection from options I want the values of the fields to be there once the form is posted to it self.
I have tried to use the following with the form, but it didn't work.
<?php
foreach($HTTP_POST_VARS as $name=>$value)
{
echo "<input type ='hidden' value='".$value."' name='".$name."'";
}
?>
here is the complete code for the form, please help
<form action= '<?php echo($PHP_SELF); ?>' method='POST' name='bf'>
<p> </p>
<table width='50%' border='0' align='center'cellpadding='4' cellspacing='0'>
<tr>
<td width='29%'><font face='Copperplate Gothic Light'>NHS Number</font></td>
<td width='68%'><input name='nhs' type='text' id='nhs'></td>
</tr>
<tr>
<td><font face='Copperplate Gothic Light'>Select hospital</font></td>
<td><select name='hosp'>
<option></option>
<option value='Hammersmith Hospital'>Hammersmith Hospital</option>
<option value='Charing Cross Hospital'>Charing Cross Hospital</option>
<option value='Selly Oak Hospital'>Selly Oak Hospital</option>
</select></td>
</tr>
<tr>
<td><font face='Copperplate Gothic Light'>find appointment</font></td>
<td><input type='submit' name="fapp" value='GO'></td>
</tr>
</table>
<?php
foreach($HTTP_POST_VARS as $name=>$value)
{
echo "<input type ='hidden' value='".$value."' name='".$name."'";
}
?>
</form>