Hello,
I am having trouble using the rename()function and I was wondering if anyone could help me out. I'm trying to write a script to rename a jpg in an images subdirectory. Here's my code:
$old=realpath("images/$oldname.jpg");
$new=dirname($old)."/$newname.jpg";
rename($old,$new);
I have verified that $old and $new are the right source & destination filenames (and paths), and I have changed ownership of the files to nobody:nobody after determining that Apache was running as nobody. However, my rename() call always fails. Can someone tell me what I'm doing wrong?
Thanks,
Tom