Hi,
I have a form and want to allow users who have already filled the form and have an ID to enter the ID and have the form filled based on the info stored in a table.
On top of the form, I have:
<input type="text" name="id" value=""> <a href="<?php echo $_SERVER['PHP_SELF'] ?>">Go!</a>
At the beginning of the file:
if (isset($id) && $id != "")
{
$query = "SELECT * from Customers WHERE CustomerID= $id");
$result = mysql_query($query);
if(mysql_numrows($result)>0)
{
"how do I set the field values, select values, etc. here?"
}
else
{
echo '<script language="javascript" type="text/javascript">
alert("The Customer ID you entered could not be found. Try again or fill out the form.")
document.info_form.id.focus();
</script>';
}
}
I am new to PHP so if you see flaws in coding, please let me know.
TIA.