Jump to content

Create Text File


my4bros
 Share

Recommended Posts

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);}?>

Edited by es131245
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. Edited by boen_robot
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...