用">
时间:2021-07-01 10:21:17 帮助过:44人阅读
输出单行直到 end-of-file
//写入文本
$myfile = fopen("newfile.txt", "a+") or die("Unable to open file!");
$username=@$_POST[username];
fwrite($myfile, $username);
$password=@$_POST[password]."
";
fwrite($myfile, $password);
//读取文件
$myfile = fopen("newfile.txt", "r") or die("Unable to open file!");
//
用户名 | 密码 | |
删除 |
$path = 'D:\wamp\www\a.txt';
$f = fopen($path, "r");
echo "用户名"." " ."密码"." 操作
";
while(!feof($f))
{
if (!feof($f)){
$buffer = fgets($f, 4096);
$arr = explode("
------解决思路----------------------
",$buffer);
if(count($arr) > 1){
echo $arr[0]." " . $arr[1]." 删除
";
}
}
}
fclose($f);
?>
$username = $_POST['username'];
$password = $_POST['password'];
$path = 'D:\wamp\www\a.txt';
$fp = fopen($path,"a");
fwrite($fp,$username."
------解决思路----------------------
".$password."\r\n");
fclose($fp);
header("Location:form.php");
?>
用户名 密码 操作
11 22 删除
33 44 删除
55 66 删除
ss dd 删除
s sss 删除