//This program is used to receive form data from HTML pages and perform corresponding verification
$founderr = false; //Initialize the founderr variable, indicating that there is no error
if(!ereg("[a-zA-Z_]", $_GET['username']))
{
echo "The name format is incorrect
";
$founderr = true;
}
if(!ereg("[0-9]{4}-[0-9]{2}-[0-9]{2}", $_GET[' birthday']))
{
echo "The date format is incorrect
";
$founderr = true;
}
if(!ereg("^[ a-zA-Z0-9_.]+@([a-zA-Z0-9_]+.)+[a-zA-Z]{2,3}$", $_GET['email']))
{
echo "E-mail address format is incorrect
";
$founderr = true;
}
if($_GET['password'] != $_GET['password2'])
{
echo "Two password entries are not the same";
$founderr = true;
}
if(!$founderr)
{
?>
Form
Name:
| |
Password: |
|
Gender: < ;/td>
| |
< ;/tr>
Birthday: |
php echo $_GET['birthday'] ?> |
E -mail: |
|
Occupation: |
|
}
?>