I need help with steps
3. check the DB to make sure the submitted data is not duplicate data;
4. if so, display an error message and show the form again;
I dont know how to display the error code on the Form. Could you provide a basic example with my code below tied into the error message showing on the form.
Below is the cod e im using now to check the database
$query1 = "SELECT * from test WHERE name = '$user'";
$result1 = mysql_query($query1) or exit(mysql_error());
if (mysql_num_rows($result1))
{
echo ' <script language = "javascript">
alert("You have entered a taken username. Please try another username")
</script>';
print '<meta http-equiv="refresh" content="0;URL=register2.html">';
}
This works but wipes out all the forms data, I would like to get the message to display on the form