这是dh.php文件
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" type="text/css" href="css.css">
<title>玖玩浏览器收集</title>
</head>
<body><div class='bd'><div class='bg'>
<center><font size=5 color=#000>浏览器列表</font></center></div><hr>
<?php
readfile('a.txt');
?><form action="jiuwap.php" method="post"><div class='bg'>请注意——</div><font size=4 color=red>请大家填写正确的浏览器地址,并写好浏览器的称!方便友友们使用……</font><div class='bg'>赶快分享你的浏览器吧!</div>
浏览器网址<br>
<input type="text" name="txt" value="http://" /><br>浏览器名称<br>
<input type="text" name="mz"><br>
<input type="submit" value="分享" /><hr>
Powered by©<a href='http://92sc.tk'>四川论坛</a><hr>
报时 : <?php
date_default_timezone_set('PRC');
echo date('Y-m-d H:i');
?>
</form></div>
</body>
</html>
这是jiuwap.php文件
<html><head><title>浏览器收录</title></head><body><?php $text=$_POST['txt'];$mz=$_POST['mz']; if((!$mz))
{
echo "请填写好你浏览器的名字!";
}
else
{
if(ereg("^[!-~] $",$text))
{
$fp=fopen("a.txt"."a");
$str="<a href={$text}>{$mz}</a>"."<hr>"; fwrite($fp,$str); fclose($fp);
echo "感谢你的分享!";
}
else
{
echo "浏览器地址只能为英文";
}
}
?></body></html>
写入文件时出错,高手帮忙改下!
@方哥_不活跃 @郑锋
if(preg_match('!^http:\/\/.{2,}!',$text))