note 91787 added to function.unlink
| From: | markandrewperry at hotmail dot co dot uk | Date: | Thu, 25 Jun 2009 12:02:51 +0000 |
| Subject: | note 91787 added to function.unlink | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157473@lists.php.net to get a copy of this message | ||
I am having trouble using the unlink() function. I have a file name posted from a form, i get this
filename and then need to delete the file but the unlink function isn't working correctly, the
code is below.
<?php
$fullname = $_POST['fullname'];
chdir('../portfolio_full');
unlink($fullname);
?>
The filename is held in $fullname and this is what i need to delete, but it only seems to work when
i hard code the file name e.g. <?php unlink('image.jpg'); ?>
does anybody know why this would happen?I have tried setting file and directory permissions and
changing the working directory but none of them worked. any help is greatly appreciated :)
----
Server IP: 209.41.74.194
Probable Submitter: 81.149.229.61
----
Manual Page -- http://www.php.net/manual/en/function.unlink.php
Edit -- https://master.php.net/note/edit/91787
Del: integrated -- https://master.php.net/note/delete/91787/integrated
Del: useless -- https://master.php.net/note/delete/91787/useless
Del: bad code -- https://master.php.net/note/delete/91787/bad+code
Del: spam -- https://master.php.net/note/delete/91787/spam
Del: non-english -- https://master.php.net/note/delete/91787/non-english
Del: in docs -- https://master.php.net/note/delete/91787/in+docs
Del: other reasons-- https://master.php.net/note/delete/91787
Reject -- https://master.php.net/note/reject/91787
Search -- https://master.php.net/manage/user-notes.php