每次输错都没提示?? 是为什么呢? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<a href="./">返回列表</a><form  method="post" action="<?php echo $PHP_SELF; ?>">
 
  <input type="text" name="date"  value="<?php echo $date; ?>"/>
  <input   type="submit" value="转换" />
  当前时间 <?=$_POST[date]?> 
</form><?
$email=$_POST[date];
if(isset($_POST[date]))
{ if ( ereg("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9\-\.])+", $email)) 
{
echo "输入正确";
}
else 
"不对<br>";
  



}?>
</body>
</html>

解决方案 »

  1.   

    <?
    $email=$_POST[date];
    if(isset($_POST[date]))
    {if ( ereg("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9\-\.])+", $email)) 
    {
    echo "输入正确";
    }
    else 
    {
    echo "不对 <br /> ";
      
    }}?> 
    你马虎了而已。
      

  2.   

    试过了 还是一样不可以~! SOS谁能帮忙
      

  3.   

    else  

    echo "不对  <br />  "; 
       

      

  4.   

    $email=$_POST[date]; ==>$email=$_POST["date"]; 
      

  5.   


    <? 
    $email=$_POST["date"]; 
    if(isset($_POST["date"])) 

      if ( ereg("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9\-\.])+", $email))  
      { 
        echo "输入正确"; 
      } 
      else  
      { 
       echo "不对<br />  "; 
      } 

    ?>   
      

  6.   

    我试了一下,这是测试email的代码,你拿它输入时间???????????????????
      

  7.   

    同上
    $email=$_POST[date]; 
    这句话是什么意思?测试email的正则测试时间,要是提示对了,我还真想见识见识