php rename failure

邮差的信 提交于 2019-12-25 08:22:00

问题


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.


回答1:


Try this :

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

Your code is correct .



来源:https://stackoverflow.com/questions/9043193/php-rename-failure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!