Roundcube Community Forum

 

how create new file php

Started by ayoub, July 30, 2009, 05:53:17 AM

Previous topic - Next topic

ayoub

I am currently developing a plugin
the problem is that I need to create a file
I tried this code:

 $a = 'hello friend';
   //$tmpfname = touch('/home/user/file.txt');
   $fp = fopen("/home/user/file.txt", "a");
   fwrite($fp,$a);
   fclose($handle);

but the problem is not resolved
Can you  help me please
thks

rosali

file_put_contents("/home/user/file.txt", $a);
Regards,
Rosali

ayoub

thks
but the problem that the file is not created

rosali

Check folder permissions. Code is ok. This is not a php support forum.
Regards,
Rosali