管理你的留言在文本文件中实现不如数据库中那么方便,下面我们想办法来实现这个效果!
在输出的时候我们是用数组来保存数据,那么我们会很方便地为每组数据按顺序分配一个序号,通过对这个序号来操作,我们就可以方便地修改数据!
$date[0]为文本文件中第一行,我们输出时分配序号为0.
输出时有这样的效果:
修改留言
我们再定制modify.php
if($id!=””){
$date=file(“txt/mytxt.txt”);
$str=explode(“&”,$date[0])
?>
}else{
$str=$tech1.”&”. $tech2. ”&”.$tech3….
If($str!=””){
//将修改后的数据写回文本文件!
}
}?>
在这个过程中要注意保持$id的值不丢失,在写回数据时先将文本中的值读入$date,再$date[$id]=$str;
$fp=fopen("txt/mytxt.txt","w");
fwrite($fp,$date);
fclose($fp);

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!
