Red
Red

Reputation: 6378

php rename failure

I have some problems with PHP Rename .

 $rm = rename($path.$package."/",$path.$get["theme_name"]."/");
                     if ($rm == FALSE)
                     {
                        return "RENAME_FAILURE";
                     }

here i got a error

A PHP Error was encountered

Severity: Warning

Message: rename(/home/pr/public_html/developer/public_themes/arkGT/,/home/pr/public_html/developer/public_themes/new_roller/) [function.rename]: Directory not empty

Filename: models/pagemodel.php

Line Number: 218

i checked the cpanel,everything is ok,the folder is renamed to new_roller...

then what is the problem with my code ?

Thank you.

Upvotes: 0

Views: 3744

Answers (1)

Kichu
Kichu

Reputation: 3267

Try this :

 $rm = rename("./public_themes/arkGT/","./public_themes/new_roller/");
    if ($rm == FALSE)
    {
     return "RENAME_FAILURE";
    }
    else
    {
    return "success";
    }

Your code is correct .

Upvotes: 1

Related Questions