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 -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -