I am trying to implement a way for user to delete files. I am using the code below but it doesn't delete the files. This file is under the root and i checked and made sure that it has permissions to allow users to do what they want, so i am thinking its the script:
$sql = "select `File` from `documents` where `user_id` = '$userid' and `doid` = '$doid'"; $query = mysql_query($sql) or die ("Error: ".mysql_error()); while ($row = mysql_fetch_array($query)){ $fn = $row['File']; } mysql_free_result($query); unlink(/userstash/$fn);