Forum Moderators: coopster
The situation is I have a template.php file, and I wan't my script to copy this file and give the new copy a new name.
This is the code so far, but it doesn't copy...
$temp = "template.php";
$file = $linktextdata . ".php";
if (!copy($temp, $file)) {
echo "copy of $temp failed";
}
I test echoed the variables, and they look ok.
Any ideas?
What you need to do is:
a) Find out what user PHP is running as on your server, then
b) Make sure that user has write permission in the directory
If you're on Linux, you can test to see if this is the problem by quickly giving everybody write access to the directory (do something like chmod a+w dirname). If that does the trick, then look up how to manage group permissions on Linux and make the user apache a member of a group that has write access to the directory you want to use.