Jump to content
xisto Community
demonlord

Updating Php File Through A Web Form

Recommended Posts

Hello, i'm not sure if this can be done with php or not but what i need is a way to make an php file that have an html form on it and it will take the info you put in to that form and write it to an existing php file, for example: if i have the file news.php and the file news_update.php. if you went to news_update.php you would get an form with a text area for you to write a new addition for the news.php file and when you hit submit it will add what you typed in the form to the file news.php. If this is going to be a big code or a hard one to make but some one thinks they can make it let me know either via post or pm and i can give some credits for the code. if some one knows of such a pre-exsting code that is free please post it. Thanks

Share this post


Link to post
Share on other sites

Do you want all of the News stories placed into the same file? or one file per story?Looks like you might be able to use a Content management system that lets the members update the site? like a wiki?

Share this post


Link to post
Share on other sites

I agree, I believe what you are trying to emulate are examples of blog posts except that the data will not be stored in a sql table but rather a file. Am I right? There are several alternatives out there like WordPress, CuteNews ... etc

Share this post


Link to post
Share on other sites

You could use fwrite for this, but I would not suggest writing directly to the php file. Instead write to a text file that the php file includes. That way if anybody finds your updater they won't be able to seriously damage your website.

Share this post


Link to post
Share on other sites

You could use fwrite for this, but I would not suggest writing directly to the php file. Instead write to a text file that the php file includes. That way if anybody finds your updater they won't be able to seriously damage your website.

how would i do that, as for the content managment softwares i'm trying to avoid thoses because for some reason they confusise the pastor of my church and it's going to be him updating the news section for the page while i take care of everything else.

Share this post


Link to post
Share on other sites

I would say to check-out Cutenews (be sure to use the recent patch) and My Little CMS.Both of them use flat-files and have a page for inserting the News Item (article). Quite easy to use.

Share this post


Link to post
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

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.