Page 1 of 1

How to have php rename a file?

Posted: Mon Mar 08, 2010 9:39 pm
by Rickpo12
How to you have php execute OS commands like mv to move a file from one directory to another. I want this to happen when the end user clicks on the submit button on a web page?
Thank you.

Rick

Re: How to have php rename a file?

Posted: Mon Mar 08, 2010 9:41 pm
by Rickpo12
Answered my own question.

rename('/path1/old_filename', '/path2/new_filename');

Rick