hello all...
im new to php so forgive me if my scripting is a bit crap...
ive built a simple member management system and everything is running great...
but
i want to create a bit of script that when the user validates their account a folder is created called their username and then a file (index.php) is copied into that directory
this is what i have so far..
// get and create variables from url
$username = $_REQUEST['username'];
$directory = "/home/httpd/vhosts/mydomain.com/httpdocs/profiles/$username";
$copytothisone = "/home/httpd/vhosts/myproprofile.com/httpdocs/$username/index.php";
// create directory
$oldumask = umask(0);
mkdir($directory, 0777); // or even 01777 so you get the sticky bit set
umask($oldumask);
// copy file into directory
$file = '/home/httpd/vhosts/mydomain.com/httpdocs/default/index.php';
$newfile = $copytothisone;
if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
its creating the directory ok using the username as the name of the directory but when it comes to copy the file into that directy its telling me no such file or directory exists even though i can see its there via my ftp program
am i missing something simple or am i on the completely wrong track
any help would be appreciated..
like i said im new to php and still learning