Vince
|
| Posted: 05/06/2002, 7:28 AM |
|
Hi,
When registering on my website, people are asked to enter a special code in a field. There are only 6 valid codes. If the code they enter does not exist, they should get an error message. How do I do this using PHP/mySQL?
Thanks
|
|
|
 |
Nicole
|
| Posted: 05/07/2002, 5:01 AM |
|
Vince,
create Validation event and use lets say dlookup function to find if the record exists, e.g.:
$exist = dLookUP("table_name", "count(*)", "code_field_name = ". ToSQL(get_param(entered_code_field_name), "Number");
if ($exists < 1)
sFormNameErr .="In valid code <br>";
If no records exist user will get error message.
Then select 'Create Validation Rule' flag on form properties to make event work.
|
|
|
 |
|