Jump to content

Archived

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

Jen

writing to file on server, beginner help

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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/fopen

I'll post a simple example in a minute

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Yes, michellm, that would be helpful.  Please send it to jenbrandner@yahoo.com.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.