如下,这两个符号应该成对出现吧,但是想如下程序就看到不明白了,特别是有whlie循环的时候,请大侠指教!~~
<?
if(!isset($_POST['email'])){
?>
<html>
<head></head>
<body>
<form action="" method="post">
email:<input type="text" name="email" value="<? echo$_COOKIE['email'];?>">
<input type="submit" name="submit" value="提交">
<?
if($_COOKIE['lastsave']){
$days=round((time()-$_COOKIE['lastsave'])/86400);
echo "<br>距离上次提交$days 天";
}
?>
</form>
</body>
</html>
<?php
}
else{
if(!empty($_POST['email'])){
setcookie("email",$_POST['email'],mktime()+(86400*30),"/");
setcookie("lastsave",time(),mktime()+(86400*30),"/");
echo"email已经记录";
}
else{echo"请输入电子邮件地址";}
}
?>
</body>
</html>
哆啦的时光机
呼唤远方