1 Çë˵Ã÷ PHP Öд«ÖµÓë´«ÒýÓõÄÇø±ð¡£Ê²Ã´Ê±ºò´«ÖµÊ²Ã´Ê±ºò´«ÒýÓã¿
´ð£º ´«ÖµÖ»ÊÇ°Ñijһ¸ö±äÁ¿µÄÖµ´«¸øÁËÁíÒ»¸ö±äÁ¿£¬¶øÒýÓÃÔò˵Ã÷Á½ÕßÖ¸ÏòÁËͬһ¸öµØ·½¡£
2 ÔÚPHPÖÐerror_reportingÕâ¸öº¯ÊýÓÐʲô×÷Óã¿
´ð£º The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script.
3 ÇëÓÃÕýÔò±í´ïʽ£¨Regular Expression£©Ð´Ò»¸öº¯ÊýÑéÖ¤µç×ÓÓʼþµÄ¸ñʽÊÇ·ñÕýÈ·¡£
´ð£º
php
if(isset($_POST['action']) &&
$_POST['action']==¡¯submitted¡¯)
{
$email=$_POST['email'];
if(!preg_match(¡°/^( :w+. )*w+@( :w+. )*w+$/¡±,$email))
{
echo
¡°µç×ÓÓʼþ¼ì²âʧ°Ü¡±;
}
else
{
echo
¡°µç×ÓÓʼþ¼ì²â³É¹¦¡±;
}
}
else
{
>
EMAIL¼ì²âtitle>
<script type="text/java script">
function checkEmail(sText)
{
var reg=/^( :w+. )*w+@( :w+. )*w+$/;
var email=document.getElementById(sText).value;
if(!reg.test(email))
{
alert("µç×ÓÓʼþ¼ì²âʧ°Ü");
}
else
{
alert("µç×ÓÓʼþ¸ñʽÕýÈ·");
}
}
script>
head>