assd23dwsa Posted August 21, 2011 Share Posted August 21, 2011 I have a form which a user enters information like age, email, address. This information is emiled to the admin. I would like the information to also be saved to a textfile on the server when the same button is pressed Please help Thank you in advance, for your time and effort Quote Link to comment https://forums.phpfreaks.com/topic/245364-php-to-save-form-entrys-to-server-in-textfile-help/ Share on other sites More sharing options...
codefossa Posted August 21, 2011 Share Posted August 21, 2011 Just as a heads-up. If it's going to be used a lot, I wouldn't use a flatfile system, I would use SQL. Flatfile causes RAM usage to shoot through the roof, as well as tons of lag server-side, which is seen client-side. <?php $file = 'info.txt'; $fp = fopen($file, 'w+'); fwrite($fp, 'This text is written to the file.'); fclose($fp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/245364-php-to-save-form-entrys-to-server-in-textfile-help/#findComment-1260220 Share on other sites More sharing options...
voip03 Posted August 21, 2011 Share Posted August 21, 2011 If you are keep on writing every user details then you need. $fh = fopen($myFile, 'a'); PS. It is wiser to use SQL Quote Link to comment https://forums.phpfreaks.com/topic/245364-php-to-save-form-entrys-to-server-in-textfile-help/#findComment-1260224 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.