BBcode

From: Date: Mon, 17 Dec 2007 03:17:16 +0000
Subject: BBcode
Groups: php.general 
Request: Send a blank email to php-general+get-265958@lists.php.net to get a copy of this message
I tested BBcode (Pear extension) with that code: if (!empty($_POST['bbcode'])) { require_once 'HTML/BBCodeParser.php'; $parser = new HTML_BBCodeParser(parse_ini_file('BBCodeParser.ini')); echo $parser->qParse($_POST['bbcode']); } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <textarea name="bbcode"> <?php echo @$_POST['bbcode']; ?> </textarea> <input type="submit" /> </form> it works! I added it to a production page, by moving BBCodeParser.ini ouside of htdocs directory. Added at the beginning of the php file: require_once 'HTML/BBCodeParser.php'; and at the wished output: echo "<TD bgcolor='yellow'>"; $parser = new HTML_BBCodeParser(parse_ini_file('../BBCodeParser.ini')); echo "<FONT face=$FFACE color=$FCOLOR>"; echo $parser->qParse($DB_DETAIL); echo "</TD>"; I tested the input of my form with: [list] [*]normal [*][b]bold[/b] [*][u]underline[/u] [*][i]italic[/i] [/list] The database field in got these data, but the output on the screen is also just: [list] [*]normal [*][b]bold[/b] [*][u]underline[/u] [*][i]italic[/i] [/list] What am I doing wrong? bye Ronald

« previous php.general (#265958) next »