Hi,
I want to pass the parameter of employee_id to a page. My code is working fine and passing parameter to page but the problem is rather then the current parameter , It is passing the previous parameter which was selected in previous submit. Below is the code.
<form action='manager_employee_select.php?proc_employee_id=<?php echo $_POST['proc_employee_id']; ?>' method="POST">
<table>
<tr> My team members timesheet</tr>
<tr>Select a team member from the list to continue</tr>
<tr>
<?php
$conn = pg_connect("host=localhost port=5432 dbname=aim user=postgres password=holiday");
$result = "select employee_id,first_name || '' || last_name as name from employee where reporting_manager_id = '1113'";
$result = pg_query($conn, $result) or die(pg_last_error());
?>
<?php echo "<td name = \"employees\" >
<select name=\"proc_employee_id\" id=\"dropdown\" >"; ?>
<option value=""></option>5
<?php
while($emps = pg_fetch_assoc($result))
{
$val = $emps["employee_id"];
$caption = $emps["name"]; ?>
<option value="<?php echo $val ?>"><?php echo $caption ?></option>
<?php } ?></select>
</td>
</tr>
</table>
<input name="submit" value="Continue" type="submit">
</form>
Many Thanks In advance