Jump to content

Create Text File


my4bros

Recommended Posts

What is your code? How isn't it working? Are there any error messages?

Link to comment
Share on other sites

I know 2 ways to create a file....1 fopen("file_path.txt",a+);Read the fopen() manualhttp://ru2.php.net/manual/en/function.fopen.phpa+ for"Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it."2touch(); same as shell =)

Link to comment
Share on other sites

i just pastet his coding<?php$file=fopen("file.txt","a+");?>And run itanf get this errorWarning: fopen(file.txt) [function.fopen]: failed to open stream: Permission denied in /home/abcd/public_html/create.php on line 2How do i solve this pls help me

Link to comment
Share on other sites

Try this and tell us what you get....<?php$file_path="file.txt";function your_code();{//paste here your code here if succeed}function change_mod(){{chmod($file_path, 0755);}if(!$file){touch($file_path) or die("PLZ Allow users to create files in www folder");}$file_open=fopen($file,a) or function change_mod();$file_open=fopen($file,a) or die("Error");fclose($file_open);}?>

Link to comment
Share on other sites

no its getting somany errors ,please give working code to create this .......i terribly need this
Contact your host, and ask them for "writing permissions within the public_html folder" and/or further assistance.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...