if ( !copy(\$file, /home/supracore/public_html/smac/test1/\$Formusername/index.'.php') ) {
print('failed to copy \$file...<br>\n'); }
I think this should be:
if (!copy (\$file, \"/home/supracore/public_html/smac/test1/\$Formusername/index.php\") ) {
on your 3rd line of actual code here.
It looks like you used the example from the PHP manual, but didn't quite understand what they were trying to do...
In the example:
if (!copy($file, $file.'.bak')) {
print ("failed to copy $file...<br>\n");
}
They are wanting to keep the same file name but append .bak to the end. In your case, you don't want to keep the same file name.
Also, using chmod to set the permissions to 777 is not very safe.
Dave