What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved]

Pages: (2): « First [ 1 ] 2 » Last »
PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved]
Author: Message:
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. PHP Help - Warning: unlink(imgs/) [function.unlink]: [resolved]
According to Nathan he told me to post this below since this is the erroring code thing I guess :P.

code:
$actual variable name here = mysql_fetch_array($other variable name);
unlink("{$actual variable name['row title goes here']}");

Anyways. Basically, in my admin panel I have a delete button which is supposed to delete the image file. But it only deletes it from the database list, but the file is still online and works. You just cannot see it in the admin panel anymore.

This is the error code

code:
Warning: unlink(imgs/) [function.unlink]: No such file or directory in /home/sonicsam/public_html/jesuswasajew/adminx/index.php on line 53

Anybody with the powers to help ;o?

This post was edited on 04-20-2007 at 08:32 PM by prashker.
04-19-2007 06:56 PM
Profile PM Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
Yeah,
I have never used unlink before and im not familiar with it :( Sorry.
And if you could help that'd be great :D
Touch Innovation - touch friendly programs/applications for the windows mobile!


04-19-2007 06:59 PM
Profile E-Mail PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
You just need to make sure you give unlink() the right path to the file. :p

If you're using a relative path, and currently in the /adminx/ directory, you'll need to use "../imgs/" instead of "imgs/"

unlink("../imgs/loljesus.jpg");
04-19-2007 07:10 PM
Profile PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in
quote:
Originally posted by WDZ
You just need to make sure you give unlink() the right path to the file. :p

If you're using a relative path, and currently in the /adminx/ directory, you'll need to use "../imgs/" instead of "imgs/"

unlink("../imgs/loljesus.jpg");


Warning: unlink(../imgs/) [function.unlink]: Is a directory in /home/sonicsam/public_html/jesuswasajew/adminx/index.php on line 53

Still does not work, but I saw a change, see bold :p.

This post was edited on 04-19-2007 at 07:20 PM by prashker.
04-19-2007 07:20 PM
Profile PM Find Quote Report
Veggie
Full Member
***

Avatar

Posts: 415
Reputation: 21
37 / Male / Flag
Joined: Sep 2004
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
quote:
Originally posted by SonicSam
quote:
Originally posted by WDZ
You just need to make sure you give unlink() the right path to the file. :p

If you're using a relative path, and currently in the /adminx/ directory, you'll need to use "../imgs/" instead of "imgs/"

unlink("../imgs/loljesus.jpg");


Warning: unlink(../imgs/) [function.unlink]: Is a directory in /home/sonicsam/public_html/jesuswasajew/adminx/index.php on line 53

Still does not work, but I saw a change, see bold :p.
you are getting that error because you are trying to delete a dir...
04-19-2007 07:23 PM
Profile E-Mail PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
well it should be finding a row in the db where a certian id matches the id its deleting.

But it doesnt seem to be working.
Touch Innovation - touch friendly programs/applications for the windows mobile!


04-19-2007 08:14 PM
Profile E-Mail PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
Ok Nathan is gone so I need someone else to help :p.
04-19-2007 08:33 PM
Profile PM Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
39 / Male / Flag
Joined: Aug 2004
Status: Away
RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in
quote:
Originally posted by SonicSam
$actual variable name here = mysql_fetch_array($other variable name);
unlink("{$actual variable name['row title goes here']}");
For the "row title" to work, shouldn't it be "fetch_assoc" and not "fetch_array"?

Edit: I really don't remember, as I haven't used fetch_array for years, so don't bite my head off for it.

This post was edited on 04-19-2007 at 10:00 PM by L. Coyote.

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

04-19-2007 09:58 PM
Profile PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
quote:
Originally posted by L. Coyote
For the "row title" to work, shouldn't it be "fetch_assoc" and not "fetch_array"?
No, that won't matter... both functions return associative indices. The difference is that fetch_assoc() only returns associative indices, while fetch_array() can return numeric indices as well.

quote:
Originally posted by Nathan
well it should be finding a row in the db where a certian id matches the id its deleting.

But it doesnt seem to be working.
So the query isn't matching any rows? The relevant code hasn't even been posted here, so it would take a psychic to figure out what the problem is... :p
04-19-2007 10:16 PM
Profile PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: PHP Help - Warning: unlink(imgs/) [function.unlink]: No such file or directory in....
Meh, wait for Nathans reply :p.

He might have fixed, dunno =p.

Naaathan?
04-19-2007 11:30 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On