Help - Search - Members - Calendar
Full Version: Online HTML Edit
HTMLHelp Forums > Programming > Server-side Scripting
ambitdesigns
I have a website that uses html and a little php. I need online users to be able to edit text, add text, add files, and add images. I need my users to be able to go to a link such as www.mysite.com/admin.php (which would be password protected) and then within that page have a way to access the files (such as images and html files) and edit the html code by using text box forms (so that the users don't have to know html but just have to enter text into a box and it inserts it into the proper html page an location).

I know this is very complex and probably will require me switching from static html to a CMS (such as wordpress, joomla, drupal) but if possible I want to avoid the switch.
pandy
Well, I'm afraid you need server side scripting, either you do it yourself, hire someone to do it or use a ready-made system.
I move the thread to the server-side forum. smile.gif
SteveL
Actually, what you're looking for isn't as hard as you might imagine. I've actually knocked out a couple of systems similar to what you're talking about in a few afternoons, as long as you have the right tools, it's pretty painless. The only caveat here is that you have to be pretty comfortable with PHP in order to do it, and since you didn't really mention your skill level there, I'm not sure this will help you much...

In any case, your problem can be divided in to three areas:
  1. User Administration
  2. The Page Editor
  3. The Display


In turn then:


User Administration:

This is fairly simple...depending on how large you expect your user base to be, and how secure you need the editing area, you have two options... Authentication via .htaccess, or the more secure and scalable option of using a database to store user information, and your own server-side code to protect that information. If you're only anticipating one or two users, the .htaccess option is quick and easy, and a lot of web hosting solutions actually make password protecting directories via this method extremely easy. The latter option requires a bit more work and research to do right.

The Page Editor

Happily, this aspect of the task is probably the easiest. There are plenty of 'ready-made' solutions for providing users with an interface to edit HTML code without having to actually know HTML themselves, (so called WYSIWYG editors). The one I recommend your attention to is the FCK Editor. It's super easy to install and almost as easy to configure the way you want.

The Display

Compared against the other two areas, this is pretty simple. The FCK editor and similar tools make it easy to store whatever information the user inputs to a database, but this is of course assuming that you're comfortable manipulating databases with PHP code. Once you've stored the data, all that's left is to 'spit it out' in the appropriate place on your output page.


I know that none of this information provides terribly concrete answers, but I hope I've at least given you a starting point or two...

Steve
Christian J
QUOTE(SteveL @ Mar 25 2009, 06:48 AM) *

The Page Editor

Happily, this aspect of the task is probably the easiest. There are plenty of 'ready-made' solutions for providing users with an interface to edit HTML code without having to actually know HTML themselves, (so called WYSIWYG editors). The one I recommend your attention to is the FCK Editor. It's super easy to install and almost as easy to configure the way you want.

FCK Editor looks pretty good for being a WYSIWYG editor (just checked it briefly though), thanks for the link! But is there a reason for using an online editor like that instead of traditional offline programs like Dreamweaver or Nvu? Offline programs are of course limited to a single computer, but that should be a minor problem for clients using laptops.

Also keep in mind that a user may create all kinds of strange solutions with a WYSIWYG editor. For example, will the user realize that <H1> etc is the best choice for headings, as opposed to making ordinary text really large? Or maybe the user will choose <H3> to make the "default" font size of text blocks larger. The same applies to offline WYSIWYG editors like Dreamweaver or Nvu.

IMO a safer approach is to let users edit actual content only, while preventing them from changing presentation as much as possible. As long as they can only edit plain text this should be relatively safe (but not very flexible).
pandy
QUOTE(Christian J @ Mar 25 2009, 11:23 AM) *

But is there a reason for using an online editor like that instead of traditional offline programs like Dreamweaver or Nvu?


Yes, since the OP wants this feature for his users.
Christian J
QUOTE(pandy @ Mar 25 2009, 12:48 PM) *

QUOTE(Christian J @ Mar 25 2009, 11:23 AM) *

But is there a reason for using an online editor like that instead of traditional offline programs like Dreamweaver or Nvu?


Yes, since the OP wants this feature for his users.

Of course. blush.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.