html - PHP unlink function does not want to work -


so want unlink file using php, send file path php through link in html. when echo path it's correct, when use unlink gives me these weird html tags inside path aswell.

heres code:

<?php     $fname = $_get['name'];     $fext = '.epub';     $fpath = $fname . $fext;     echo $fpath;     unlink ($fpath); ?> 

heres link:

echo '<a href="delete.php?name=ebooks/'.urlencode($name).'" onclick="return confirm(\'are sure?\')">delete</a>'; 

this script outputs in browser window:

ebooks/alice.epub

warning: unlink(ebooks/      <span class="title">alice</span><span class="author"></author>.epub): invalid argument in c:\xampp\htdocs\assignment\delete.php on line 6 

ok solution changed unlink this:

unlink (strip_tags($fpath)); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -