looking for a php script
David P. Schwartz
plug-discuss@lists.PLUG.phoenix.az.us
Mon, 15 Oct 2001 03:08:24 -0700
I'm working on a web site that I'd like to have the facility whereby the
client can edit the content of certain pages. I happen to be using
NetObjects Fusion MX to create the site, but the tool here is really
irrelevant. It's creating HTML web pages with some common javascript for
button animations and css stuff in them.
Does anybody here know of a script that's available somewhere to handle
this? I'm not really sure what I'd search for in any of the obvious places,
so I figured I'd just describe what I want here and maybe someone knows of
something.
Here's my thinking: it ought to be relatively straightforward to have a php
script that can be referenced in a short line of code anywhere on a web page
that you wanted to make client-editable. (I like php, but perl would
probably work fine too.) Eg, the text in a block on the "About Us" page
would be replaced with something like:
<?php getmytext("about_us_text") ?>
In normal use, this bit of script would simply extract some text from a
database field that matches the key string (the argument) and simply print
it out, allowing the page to look as if it's just a static HTML page.
When the user happens to have some kind of flag set somewhere (eg., a
cookie, env var, etc), the script would display the text from the database
field and add an "edit" button. If the user clicks the edit button, a
pop-up window appears with an HTML textbox containing the text, and two
buttons like save and cancel that do the obvious. An alternate approach
would be to display the text inside an HTML Textbox instead of as text on
the form, along with a save button.
I can imagine lots of embellishments that could be added without much
trouble...
Thanks!
-David Schwartz