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
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?

Link to comment
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.. :(

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.