<?
$datafile="maildate.txt";

if($uemail){
$arrmail=file($datafile);
$howmail=count($arrmail);
 for($i=0;$i<$howmail;$i++){
$email=$uemail ."\n";
if($arrmail[$i]==$email){
echo "邮件地址:$email; 已经订阅我站E周刊，勿需重复注册，谢谢！";
exit;
}
}

   	if(eregi("^.+@.+\\..+$",$uemail)){

   	echo "<center><h2>欢迎订阅E周刊!</h2></center>";

   	}

   	elseif(eregi("^.+@.+\\..+\\..+$",$uemail)){

   	echo "<center><h2>欢迎订阅E周刊!</h2></center>";

     } else {

    echo "<center><h2>您输入的邮件地址有问题！请确认!</h2></center>";
	exit;

    }
    }

   else{

      echo "<center><h2>您没有输入邮件地址</h2></center>";
	  exit;

     }
   	  $email=$uemail."\n";

   	  $fp=fopen($datafile,a);

   	  fwrite($fp,$email);

   	  fclose($fp);

   	  echo "您的邮件地址是：$uemail";

   	  echo "已经成功订阅E周刊，谢谢！";
   ?>