Re: Re: Best way to allow a user to indicate formatting to be displayed but stored.

From: Date: Thu, 30 Sep 2004 16:42:05 +0000
Subject: Re: Re: Best way to allow a user to indicate formatting to be displayed but stored.
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-198301@lists.php.net to get a copy of this message
GH wrote:
Are there anyother methods besides BBCode/phpBB that one can use? Especially if I do not have pear available on my host?
I'm sure there are. For example you can convert the string using htmlspecialchars, and then convert only allowed tags back: $text = htmlspecialchars($_POST['text']); $replace_to = array('<b>', '</b>'); $replace_from = array(); foreach($replace_to as $tag) { $replace_from[] = htmlspecialchars($tag); } $text = str_replace($replace_from, $replace_to, $text); You can install pear in your account, just unpack the archive and set include_path.
On Thu, 30 Sep 2004 18:27:52 +0200, Marek Kilimajer <lists@kilimajer.net> wrote:
GH wrote:
On Thu, 30 Sep 2004 18:17:05 +0200, Marek Kilimajer <lists@kilimajer.net> wrote:
GH wrote:
Thank you all for the information... however at a second look I realized that I failed to better describe my needs... My current plan is to have a series of articles and information stored in my database... The table will have a ID, Title, Author, Image, Content, Date/Time What I would like to have is say someone needs to do a sub heading... I would like to have it automatically be the same subheading format for all of the content... in addition to the formatting...
The answer is CSS.
from what I understand it phpBB works only for BBcode... so how would I be able to make is so that they do not manually have to change the CSS or apply the CSS?
I'm not sure how you format subheading in bb code, but I guess you will need to modify the function or class that converts bb code to html and change the rule for subheading tag
Also... I saw one refer to PEAR, since I am on a shared server is there a way to test if pear is available... (never worked with it and am still new to PHP sorry)
<?php require('PEAR.php'); ?> If that does not give you error, PEAR is installed. Not necessarily all packages.


« previous php.general (#198301) next »