0
I have a file that shows the time and name that a user logged in to the site, this file is password protected, is there any way to put a [Delete] button to delete certain line ?
I use the following code
$f = fopen("pass/index.html", "a");
fwrite ($f,
'Usuario: [<b><font color="#660000">'.$usuario.'</font></b>]
IP: [<b><font color="#996600">'.$ip.'</font></b>]
Data: [<b><font color="#FF6633">'.$data.'</font></b>]<br> ');
fclose($f);
On file it looks like this:
Usuario: [<b><font color="#660000">teste1</font></b>] IP: [<b><font color="#996600">xxx.xxx.xxx.xxx</font></b>] Data: [<b><font color="#FF6633">07-07-2017 - 13:20:01</font></b>]<br>
User: [teste1] IP: [xxx.xxx.xxx.xxx] Date: [07-07-2017 - 13:20:01]
I would like after the time to have a [Delete] to remove that line.
Ever thought of using Sqlite?
– Guilherme Nascimento
I’m using a free lodging, not possible
– Natanael Nicolas
Try this: https://github.com/bluelovers/txtSQL
– Guilherme Nascimento
Actually wanted the button to be in the html file itself
– Natanael Nicolas
PHP has nothing to do with HTML, PHP is back-end and HTML is front-end, you will use txtSQL on the back and you will create a button on the front (html) that will send a request to the back-end (php) and PHP will run txtSQL and voilà.
– Guilherme Nascimento
free hosting with php, who is?
– user60252
Actually in the file it is like this User: [<b><font color="#660000">teste1</font></b>] IP: [<b><font color="#996600">xxx.xxx.xxx.xxx</font></b>] Date: [<b><font color="#F6633">07-07-2017 - 13:20:01</font></b>]<br>
– user60252
It would be interesting to post the HTML of the page because it could make it much easier to search for this line
– user60252
Explain these files better. A file that saves the data in another file? Or is it just a file for everything?
– user60252
The login page saves the time and number of users when they connect, I want to put a "boot" [Delete] affix each line to delete that line
– Natanael Nicolas
@Leocaracciolo These are two files, one that takes the username and date and saves the data in an HTML file. this HTML file is used as "log", but expensive that for each information has a button to delete a line of information .
– Natanael Nicolas
Apparently the HTML is composed only with these lines and nothing else. See the answer.
– user60252