Web Hosting Talk







View Full Version : Help Please


J. Williams
09-19-2002, 05:39 PM
:( okay i am in desperate need of some type of php script that you can use to update a page, I have created one that writes data to a file but i need it to work so that when you update it all you have to fill in is the feilds you want to change

Please Help!

EricP
09-19-2002, 06:17 PM
Well, PHP is not my strong point, but what you could do is this:

Make the 1st page a form that posts to the 2nd page.

The 2nd page uses the Request Object where you want the new info to appear. Then the 2nd page updates the data.

Is there some type of syntax help you need? Im sure some of the PHP Gurus here would love to help you out if you posted some more details about what you are trying to do.

turnball
09-20-2002, 02:53 AM
add comment tags such as

<!--Content Begins-->

to the html file. Then within the script that does the work you will open the html doc, str_replace('<!--Content Begins-->','<!--Content Begins-->\n$CONTENT',$file_buffer);

then all you have to do is write the file back to itself and you get your data. You could see how by treating the fopen file buffer and reading out line by line, you could eventually build an entire page builder application using a series of comment tags and replace statements.

Sloopy and rather a pain to write out completely, but if you are choosing html files versus useing data driven content, there isnt much of a choice. You could get a little fancy with the code and maybe complete it in under 20 lines for a full blown application sitebuilder type app but it would still be a little more trouble then it is worth IMO.

J. Williams
09-20-2002, 04:22 PM
is it possible to make it so the varibles are saved in a file?

Xandra
09-20-2002, 06:26 PM
Do you want to code one yourself or want to download one? Because there's a downloadable one at http://cafelog.com that you can use to update your website. It has categories and everything. It would be easier hacking something rather than coding your own from scratch :)

As for variables... if you have a lot of them, I'd recommend a database.