PDA

View Full Version : A way of doing this... +REP



myke
16-05-2009, 03:33 PM
hiii..
right... i have a web layout.
part of it is "latest news"...
it's a html file, and I basically just want to be able to go to a "site panel" like /admin.html or w.e and then in the input box type the latest story, allowing html and then it adds to the homepage, not like cutenews or anything, I just want something that basic. so it only has to store one story at a time.

any ideas?

been looking at "php write" function, I used that before.

any idea?

thanks guys.

Mentor
16-05-2009, 04:29 PM
Going from the post your php skills may need quite a bit of work, but simplest way to do this is just have a form point to a php script that'll read the post header containing the data and dump it in a static file
file_put_contents("filename.txt",$_POST['newdata']);

then read it backout with
file_get_contents("filename.txt"); and echo it where you want it placed in your page.

Check the php manual for each, both functions are pretty simple ways of reading and writing a file. Make sure you chmod whatever file u are reading/writing to as 777 though :)

Want to hide these adverts? Register an account for free!