perezf Posted June 15, 2006 Share Posted June 15, 2006 i need help desperatelyI need a way where i can have a user type information into a form and submit itafter it is submited it should be saved to the server and ready to seewriting to a txt filecan someone help Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted June 15, 2006 Share Posted June 15, 2006 Have a look at file_put_contents.If you do not have php 5 then you will need to usefopenfwritefclose Quote Link to comment Share on other sites More sharing options...
Uglytroll Posted June 18, 2006 Share Posted June 18, 2006 I am having probs with Fopen as well.Recieving this error when attempting to write to textfilePHP Warning: fopen(TS345.txt) [function.fopen]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\index.php on line 135 PHP Warning: fputs(): supplied argument is not a valid stream resource in c:\Inetpub\wwwroot\index.php on line 235 PHP Warning: fclose(): supplied argument is not a valid stream resource in c:\Inetpub\wwwroot\index.php on line 137 PHP Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for the_only_uglytroll@shaw.ca in c:\Inetpub\wwwroot\index.php on line 170 Quote Link to comment Share on other sites More sharing options...
Shaon Posted June 18, 2006 Share Posted June 18, 2006 [!--quoteo(post=384082:date=Jun 15 2006, 12:49 AM:name=perezf)--][div class=\'quotetop\']QUOTE(perezf @ Jun 15 2006, 12:49 AM) [snapback]384082[/snapback][/div][div class=\'quotemain\'][!--quotec--]i need help desperatelyI need a way where i can have a user type information into a form and submit itafter it is submited it should be saved to the server and ready to seewriting to a txt filecan someone help[/quote]Hi,Try with this [code]function savefile($filename,$content){ if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $content) === FALSE) { echo "Cannot write to file ($filename)"; exit; } fclose($handle); return true;}[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.