I have been trying to get this working for days might just be a simple error I have tried almost everything to get it working but still no success.
So I thought I would let you guys have a crack at it for me.
the coding is a snippet out of a long page so the headers are not there.
The address is domain.co.uk/page.php?action=smiliedel&smid=10&sid=611cf47e54f8 2163bc5c74857cd311af
The results I am getting is
Warning: unlink(./smilies/'Resource id #16') [function.unlink]: No such file or directory in /home/sites/domain.co.uk/public_html/page.php on line 614
Error deleting smilie file with
file link - Resource id #17
File ID - 10
File Name - 'Resource id #16'
the line 614 corresponds to
Any help will be appreciated.
So I thought I would let you guys have a crack at it for me.
the coding is a snippet out of a long page so the headers are not there.
PHP Code:
else if($action=="smiliedel"){
$smid = $_GET["smid"];
$sql = "SELECT filename FROM ibwf_smilies WHERE id ='$smid'";
$file = mysql_query($sql);
$delfile = mysql_query("SELECT imgsrc FROM ibwf_smilies WHERE id ='$smid'");
///$delfile = mysql_fetch_array(mysql_query("SELECT imgsrc FROM ibwf_smilies WHERE id='".$smid."'"));
echo "<p align=\"center\">";
echo "<br/>";
$res = unlink("./smilies/'$file'");
if($res){
echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"O\"/>Smilie file deleted successfully";
}else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Error deleting smilie file with<br/> file link - $delfile<br/>File ID - ".$smid." <br/>File Name - '$file' ";
exit();
}
$res = mysql_query("DELETE FROM ibwf_smilies WHERE id='".$smid."'");
if($res){
echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"O\"/>Smilie code deleted successfully<br/><br/>";
}else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Error deleting smilie code with<br/> file link - $delfile<br/>File ID - ".$smid." <br/>File Name - '$file' ";
exit();
}
echo "<a href=\"lists.php?action=smilies&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Smilies List</a>";
echo "</p>";
}
The results I am getting is
Warning: unlink(./smilies/'Resource id #16') [function.unlink]: No such file or directory in /home/sites/domain.co.uk/public_html/page.php on line 614
Error deleting smilie file with
file link - Resource id #17
File ID - 10
File Name - 'Resource id #16'
the line 614 corresponds to
PHP Code:
$res = unlink("./smilies/'$file'");
Comment