Hi guys,

I am trying to copy two empty files and then write something inside the file but my code doesn't seem to work.. it does not even copy my files..

can u guys take a look at my code :
Code:
  $std_pages = array("name"      => "name.php",
                            "index"         => "index.htm");

         while (list($name,$value) = each($std_pages)) {

              copy("/home/mysite/public_html/webfile/std_pages/$value", "/home/mysite/public_html/members/$web_add/$value");
              chmod("/home/mysite/public_html/members/$web_add/$value", 0755);
         }

// Create Index file

   $index_file = "index.htm";

   chmod("/home/mysite/public_html/members/$web_add/$index_file", 0777) or die("Unable to create index file"); 
   $fp = fopen("/home/mysite/public_html/members/$web_add/$index_file","w+");

   $buffer .= "<html>\n<head>\n";
   $buffer .= "<meta http-equiv=\"Refresh\" content=\"0; URL=http://www.mysite.com/members/$web_add/home.php\">\n";
   $buffer .= "</head> \n";
   $buffer .= "<body></body>\n</html>";

   fwrite($fp, $buffer, 10000);
   fclose($fp);
   chmod("/home/mysite/public_html/members/$web_add/$index_file", 0755) or die("Unable to create index file");

   $name_file = "name.php";

   chmod("/home/mysite/public_html/members/$web_add/$name_file", 0777) or die("Unable to create name file");   
   $fd = fopen("/home/mysite/public_html/members/$web_add/$name_file","w+");

   $buffer2 = "<? \$i = \"$id\" ?>";

   fwrite($fd, $buffer2, 10000);
   fclose($fd);
   chmod("/home/mysite/public_html/members/$web_add/$name_file", 0755) or die("Unable to create name file");

for your information, the name.php and this index.htm files are empty file (0kb).. no error displayed when i run the script..

please give me an idea how to make this work.. thanks.