To execute a function on click in php?

How to perform this function clicks the links?
// delete function file
 unlincfile function($badf){
unlinc($badf);
 }

<a href="?what to write here?">Remove</a>
Tried so
<a href="/road.php?event=unlincfile('filefile.txt')">add</a>

But, something special.
July 12th 19 at 16:52
3 answers
July 12th 19 at 16:54
You absolutely do not know what PHP and JS. First, find out what it is and what is used.
You need to write what you need.
Maybe it should be Ajax, can link with a get parameter, or form
I just don't know how to link js and php. And js do not know. - wiley_Torphy70 commented on July 12th 19 at 16:57
: Then for any learning or order work. You're going to do and will make mistakes - Destiny86 commented on July 12th 19 at 17:00
It'll be my mistakes) And I will better understand and know. If I buy, then I do so will learn nothing)) - wiley_Torphy70 commented on July 12th 19 at 17:03
At least tell me how to do it properly, most likely to pass from js to php? - wiley_Torphy70 commented on July 12th 19 at 17:06
And if possible where to read about it, with examples? - wiley_Torphy70 commented on July 12th 19 at 17:09
: Maybe it should be Ajax, can link with a get parameter, or form - Destiny86 commented on July 12th 19 at 17:12
July 12th 19 at 16:56
// file : delete.php
if (isset($_GET['path'])) {
unlink($_GET['path']);
}


<a href="delete.php?path=filefile.txt">delete</a>

The problem with this code is that:
<a href="delete.php?path=index.php"> UPS.. </a>

In General, I fully agree with the commentators! Learn PHP, JS. At least the basics!
July 12th 19 at 16:58
Then tell me where you have posted this wonderful code :)

Find more questions by tags PHPJavaScript