Hi,
    I have been trying to create a directory and a file in it on my server, but my 
code is not working fine.
<?php
 
 
 $arquivo = fopen("publico/diretorio.txt","r");
 $cont = fread($arquivo, 5);
 $cont++;
 fclose ($arquivo);
    
 
 $arquivo = fopen ("publico/diretorio.txt","w+");
 fwrite ($arquivo, $cont);
 fclose ($arquivo);
 setcookie("cont", $cont);
 $diretorio = "d".$cont;
 
 if (!is_dir("publico/$diretorio")){
 $dirteste = mkdir("publico/$diretorio",0777);}
 if ($textfile = fopen("publico/$diretorio/index.html", "w+")){
  fputs($textfile,ob_get_contents());
  fclose($textfile);
  chmod("publico/$diretorio/index.html", 0755);}
  
  
ob_end_flush(); 
?>
    This was working fine and then stoped. Does anybody know what happened?????


I have permission to write but I'm receving the following message:

Warning: fopen("publico/d6/index.html","w+") - Permission denied in 
/home/a0010927/public_html/index.php on line 56


Reply via email to