Jump to content

Rename/Move file to folder?


electrix

Recommended Posts

Before anyone says anything, YES I have searched on this forum and google without luck!

 

<?php
echo $_GET[filename1]." - GET<BR>";
$file = "/$_GET[filename1]";
$file2 = "/ny/$file";

rename('$file','$file2');

}
?>

 

I want to move the file that is in "root" (aka "/")

to the folder "ny". All the file/folder permissions is 777.

 

The file still won't move or even copy to the folder or any other folder....?

Anybody? Or maybe you know a better way to move a filer to a folder?

 

Thanx in advance..

 

Link to comment
https://forums.phpfreaks.com/topic/57579-renamemove-file-to-folder/
Share on other sites

Might want to try file_exists() to see if it's even there before copying. More absolute paths? or maybe "./ny/" or "./" . $file might help. I don't know what $file is really, just giving ideas. Is it a filename? or name+path?

 

It's a filename.. And yes I've tried ./ and absolute paths.. Still not working.. :(

Ahh! I've got an error-message now...

 

Warning: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 200453 is not allowed to access / owned by uid 0 in /customers/randomriot.net/randomriot.net/httpd.www/move.php on line 14

failed to copy tradera.txt...

 

Can someone tell me if there is a way to override SAFE MODE or another way to copy/move a file ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.