Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
unlink funcation error
Old 06-08-2009, 09:54 AM unlink funcation error
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
Hi all,

Try to use unlink function to remove somthink and I get this appear on the page when try run it .

Code:
Warning: unlink() [function.unlink]: Unable to access assets/images/gallery/thumb/thumb_1264784987.jpg in /customers/sallyanncharters.co.uk/sallyanncharters.co.uk/httpd.www/Update/del.php on line 22

Warning: unlink() [function.unlink]: Unable to access assets/images/gallery/full/1240463278.jpg in /customers/sallyanncharters.co.uk/sallyanncharters.co.uk/httpd.www/Update/del.php on line 23
the code for the page is

Code:
<?php
if(isset($_GET['delimage']))
{
 
//get image from the database
$query = "SELECT * FROM  gal_images  WHERE imageID = '{$_GET['delimage']}'";
$result = mysql_query($query) or die('problem: ' . mysql_error());
 
//add data to an object
$row = mysql_fetch_object ($result); 
 
//if the image thumbnail and full image is not empty then remove the image from the server
if($row->imageThumb !== '' && $row->imageFull !== '')
{
	unlink ($row->imageThumb);
	unlink ($row->imageFull);
}	
 
//delete image from database
$query = "DELETE FROM gal_images WHERE imageID = '{$_GET['delimage']}'";
mysql_query($query) or die('Error : ' . mysql_error());
 

}

 
?>
and the lines 22 and lines 23 are .

Code:
unlink ($row->imageThumb);
	unlink ($row->imageFull);
any help would be nice thanks
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
 
Register now for full access!
Old 06-08-2009, 01:13 PM Re: unlink funcation error
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You should use file_exists to make sure that the file is there before you try to delete it. Also make sure that the file is being created correctly.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to unlink funcation error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.50288 seconds with 12 queries