By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

User editing

P: n/a
I asked this earlier and received a tip of going to Joomla. Problem is
according to the gurus in their forums I need to rewrite the entire site so
that Joomla becomes the core. As I am on 700+ pages its not practical as I
only need to open up two pages for user editing.

I have a website consisting of pages made up of php segments using the
include statement. The top, left and right panels are static and the text in
the center changes according to which menu/sub menu is chosen.

page1.php consists of top.php, left.php, right.php, and blue.php
page2.php consists of top.php, left.php, right.php, and red.php

It's blue.php and red.php that need to be opened up for selected users. But
the browser displays and the user sees "page1.php" or "page2.php".

What I want is a button in left.php for selected users to log in. Once they
have logged in they should be able to browse the site as normal but when -
for instance seeing text on page2.php that needs changing they can press a
text edit button. This would edit the text in red.php leaving everything
else alone.

Is there a program that allows me to do this without me having to rewrite
the entire site?

Garry Jones
Sweden

Sep 22 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Fri, 22 Sep 2006 17:16:49 +0200, "Garry Jones"
<ga*********@morack.sewrote:

>What I want is a button in left.php for selected users to log in. Once they
have logged in they should be able to browse the site as normal but when -
for instance seeing text on page2.php that needs changing they can press a
text edit button. This would edit the text in red.php leaving everything
else alone.

Is there a program that allows me to do this without me having to rewrite
the entire site?
This is pretty much the sort of thing that PHP was created for. Let them
edit the text in a textarea input. On the server, use the PHP
strip_tags function to remove any undesirable elements from the entered
text and pop the result into (say) a text file. The page 'include's that
text file at the appropriate point.

If this isn't sufficient info, try comp.lang.php

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Sep 22 '06 #2

P: n/a
Stephen Poley wrote:
On the server, use the PHP strip_tags function to remove any
undesirable elements from the entered text and pop the result into
(say) a text file.
Please don't use strip_tags(). If you don't want to allow any HTML at
all, htmlentities() would be a better choice, because it allows the user
to insert literal HTML (or other markup) into the text, which is a
reasonable thing for them to want to do. If you want to allow some
limited HTML, strip_tags still isn't a good choice, because it doesn't
restrict attributes and a malicious user could put bad JavaScript inside
an event handler.
Sep 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.