<form name="frm" action="<?=$_SERVER['PHP_SELF']?>?view=cust" method="POST">
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0" >
<tr>
<td height="30" colspan="2"><b>CUSTOMER - Enter New Order </b></td>
</tr>
<tr>
<input name="view" type="hidden" value="c_order">
<input name="site_id" type="hidden" value="<?=$site_id?>">
<td width="35%" class="mdm">Customer ID </td>
<td class="sml">
<select name="cust" class="tbox" onChange()>
<?
$res = mysql_query("select * from tblcustomer");
$cnt = mysql_num_rows($res);
$x=0;
while ($x<$cnt)
{
$user_id = mysql_result($res,$x,"user_id");
$lname = mysql_result($res,$x,"lastname");
$fname = mysql_result($res,$x,"firstname");
?>
<option value="<?=$user_id?>" selected><? echo "$fname "; echo "$lname"?></option>
<?
$x++;
}
?>
</select>
</td>
</tr>
<tr>
<td class="mdm">Address:</td>
<td class="mdm">
It will query from the table info
$res = mysql_query("select * from tblinfo where id=$user_id ");
$cnt = mysql_num_rows($res);
<input type="text" name="address" value="The value will be based on the selection and the output of the above query">
</td>
</tr>