dear Plutark,

Thank you for your input.

But, let's say that I have the following:

<span class="textdisplayplain">
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
</span>
<br><br>
<span class="textdisplayplain">
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
</span>

My user don't know html. At all... So how do I do to create an edit admin
that let him only modify the text?

I did something like this:

<span class="textdisplayplain">
<!-- text entry start -->
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
<!-- text entry end -->
</span>
<br><br>
<span class="textdisplayplain">
<!-- text entry start -->
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
<!-- text entry end -->
</span>

It works fine, because I identify the edit areas by the comment tags.
The problem with this is that if I put an option like Add New Page to the
admin system, the user would have to surround the tags with the comments, I
mean, he would have to edit the HTML.

Pretty toff thing!!!

Jesus!!

Thank you,

Rom

-----Original Message-----
From: Plutarck [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 10:25 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Dynamic built web pages administration


If you are storing the content in a database, your job is a ton easier.

Just add an edit link on the page you want people to be able to edit. It
will link over to an edit page with the value of the current page sent in
the URL via get.

Get the content from the database pointed to by the url, and stick it in a
variable.

On the edit page have a text area. Set the "value" to the content the person
can edit.

When someone clicks submit, just take the content they submit and stuff it
into the database using UPDATE.

Of course you will need to do safety features like stripslashes() or the
special character functions before storing the data, just to be safe. You
will also want to have the option only available for registered users, and
you probably want to limit it to users you know won't be malicious.

There are many little tricks like using a little piece of javascript to
execute a file on the hard drive that shouldn't be executed, malicious
ActiveX controls, java applets, etc, that you don't want users writing to
the page.

But for administration used by only trusted people, it's actually pretty
simple to put together. For use by people who aren't trusted...


--
Plutarck
Should be working on something...
..but forgot what it was.


""Romulo Roberto Pereira"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I was wondering if anybody have developed something related to dynamic web
> pages building and administration. I need to store the content of the site
> in the database and later as the user navigate, mount the content using
> templates. This part is easy, since PHP is very powerfull in this area. My
> problem would be to let the user modify the actual page content... how?
any
> ideas?
>
> TIA,
>
> Rom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to