Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: ayoub on July 30, 2009, 05:53:17 AM

Title: how create new file php
Post by: ayoub on July 30, 2009, 05:53:17 AM
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
Title: how create new file php
Post by: rosali on July 30, 2009, 07:23:04 AM
file_put_contents("/home/user/file.txt", $a);
Title: how create new file php
Post by: ayoub on July 31, 2009, 03:46:14 AM
thks
but the problem that the file is not created
Title: how create new file php
Post by: rosali on July 31, 2009, 03:47:43 AM
Check folder permissions. Code is ok. This is not a php support forum.