0

I'm making a web page for a company that they can go to and fill out a form and it will create a copy of a directory, rename the directory, and change only one file (.php) that contains the property information. I then want to use fwrite() or something like that to change the data inside information.php. What is the best way to do this? Can I use the PHP copy() function on a directory? Could I write something like this:

rename(copy('directory/to/copy'), 'path/to/new_dir');

and then

fwrite('path/to/new_dir/information.php', $predefined_string_of_php_code);

Thanks a lot... I am completely new to all file system/directory functions in php, so... yeah.

Also, when I use the copy() function or something similar, will I actually see the new file/folder in the FTP? Could I later delete it if I was just testing it out?

user1978142
  • 7,946
  • 3
  • 17
  • 20
BestAnswer
  • 136
  • 1
  • 18
  • 1
    Why don't you try it and see? – John Conde Apr 25 '14 at 02:21
  • Boss doesn't have an intrinet (is that how it's spelled?) url for me, and I don't really want to do it on my own domain. In fact, there's something else I wonder about... I'll add to my question. – BestAnswer Apr 25 '14 at 02:24
  • 1
    Documentation: http://www.php.net/manual/en/function.copy.php and http://uk1.php.net/manual/en/function.rename.php – RiggsFolly Apr 25 '14 at 02:30

0 Answers0