网站日志记录[请帮帮我] [英] Site log recording [help me please]
问题描述
如何在我的网站上将数据添加到url和txt文件?
我尝试过:
<?php
$ who = $ _ GET [text];
if(!empty($ who)){
$ old = file_get_contents(weblog.txt);
$ new = $ eski。 。 $ who;
file_put_contents(sitelog.txt,$ new);
echo成功;
}
?>
我把它保存为log.php
website.com/text?=123
文本123保存在weblog.txt文件中,
但是当我再次尝试另一个文本时,它会用旧的替换它
我要添加,而不是更改
我在等待你的帮助
How can I add data to url and txt file on my website?
What I have tried:
<?php
$who=$_GET["text"];
if (! empty($who)){
$old=file_get_contents("weblog.txt");
$new= $eski. "" . $who ;
file_put_contents("sitelog.txt",$new);
echo"Success";
}
?>
I saved this as log.php
website.com/text?=123
The text "123" is saved in the weblog.txt file,
but when I try another text again it replaces it with the old one
I want to add, instead of changing
I'm waiting for your help
推荐答案
who =
_GET [text];
if(!empty(
_GET["text"];
if (! empty(
who)){
who)){
这篇关于网站日志记录[请帮帮我]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!