正在试图测试是否正确输入了电子邮件地址。我从一系列字符开始,然后是@字符,另一系列字符,句点(。)和最后一系列字符。
<?php
// determine whether phone number is valid and print
// an error message if not
if (!preg_match( "/^\([a-zA-Z]\) [a-zA-Z]@[a-zA-Z].[a-zA-Z]$/",
$_POST["email"]))
{
print( "<p class = 'error'>Invalid email</p>
<p>A valid email must be in the form
example@den.com </p><p>Click the Back button,
enter a valid email and resubmit.</p>
<p>Thank You.</p></body></html>" );
die(); // terminate script execution
}
?><!-- end PHP script -->
<p>Hi <?php print( $_POST["fname"] ); ?>. Thank you for
completing the survey. You have been added to the
<p>Email: <?php print( $_POST["email"] ); ?></p>
我认为我在这一行中的错误
preg_match( "/^\([a-zA-Z]\) [a-zA-Z]@[a-zA-Z].[a-zA-Z]$/",
如何制作字符,后跟@字符,另一系列字符,句点(。)和最后一系列字符。