i'm sure you mean unlink but either way
something like this should work
Page1.php
<html>
<body>
<A href="page2.php?file=unwanted.txt">click here to delete</a>
</body>
</html>
Page2.php
<?
if (!empty($_GET['file'])) {
// Checking to see if the variable is not empty
if (substr($_GET['file'], -4, 4) == '.txt') {
// Check to see if the file extension is txt so
// people cant delete files you want to keep
if (unlink($_GET['file'])) {
// File delete sucessfully
echo "File : ".$_GET['file'].", Deleted";
}
else {
// File not deleted
echo "File : ".$_GET['file'].", Not Deleted";
}
}
else {
// File not a txt file
echo "You cannot delete : ".$_GET['file'].", because it isnt a txt file";
}
}
else {
// Variable empty, prompt to re-enter
echo "No page submitted, please try again";
}
?>