|
-
May 25th, 2006, 05:38 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Problem in renaming directories
Hello
How can I rename directories?
I wrote this code:
<?php
rename ("old","new");
?>
And I set the folder permission to "777".
When I open the page, the error shows:
Warning: rename(old,new): Permission denied in /home/onh1/domains/onh1986.com/public_html/eenglish/a.php
Note: I use PHP version 4.4.
What's problem, please?
Thanks & Regards
-
May 25th, 2006, 12:30 PM
#2
Re: Problem in renaming directories
When you rename a directory, you are not modifing the directory itsself, rather, you are modifying the directory listing of the parent directory. Therefroe, you need to have the appropriate permissions on the parent directory of the directory your want to rename.
Renaming is exaclty the same as moving a file or directory. This is actually what PHP does when you call rename.
-
May 25th, 2006, 03:45 PM
#3
Thread Starter
Addicted Member
Re: Problem in renaming directories
What's the code exactly to rename a directory?
-
May 25th, 2006, 04:05 PM
#4
Re: Problem in renaming directories
Read my reply. Somewhere, in that you'll find your answer.
-
May 25th, 2006, 04:19 PM
#5
Thread Starter
Addicted Member
Re: Problem in renaming directories
I did't understand.
Can u explain me more on how to rename a directory, please?
I set permission to "read/write", but I couldn't rename it.
-
May 25th, 2006, 04:24 PM
#6
Re: Problem in renaming directories
You need to set the permissions on the parent directory. Not the directory you are moving. You don't need to modify any code.
-
May 25th, 2006, 04:37 PM
#7
Thread Starter
Addicted Member
Re: Problem in renaming directories
It's working.
Thanks very very much.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|