Jen Posted August 7, 2006 Share Posted August 7, 2006 Hi all,I am trying to teach myself a little PHP so I can put a news box on a website I'm designing. The news will be just a simple paragraph, not a blog, and it needs to be updated periodically by the site's owner. I plan to store the news content in a separate news.txt file on the server, and just use an include() to put the content onto the web page. What I need to know is how to use a form to input the news content and then write it to news.txt.Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/16818-writing-to-file-on-server-beginner-help/ Share on other sites More sharing options...
wildteen88 Posted August 7, 2006 Share Posted August 7, 2006 To write a file on the server you can use fopen, fwrite and and fclose. All these functions are explained over at http://www.php.net/fopenI'll post a simple example in a minute Quote Link to comment https://forums.phpfreaks.com/topic/16818-writing-to-file-on-server-beginner-help/#findComment-70794 Share on other sites More sharing options...
mitchellm Posted August 7, 2006 Share Posted August 7, 2006 Jen, perhaps you'd be interested in a script I wrote not too long ago.It's very simple, and was originally used for a 'website notepad.' However, it'd be perfect for you. If you're interested, I'll send you the zip file with the files and instructions. Quote Link to comment https://forums.phpfreaks.com/topic/16818-writing-to-file-on-server-beginner-help/#findComment-70799 Share on other sites More sharing options...
Jen Posted August 7, 2006 Author Share Posted August 7, 2006 Yes, michellm, that would be helpful. Please send it to [email protected]. Quote Link to comment https://forums.phpfreaks.com/topic/16818-writing-to-file-on-server-beginner-help/#findComment-70803 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.