BBcode

This is a discussion on BBcode within the PHP General forums, part of the PHP Programming Forums category; I tested BBcode (Pear extension) with that code: if (!empty($_POST['bbcode'])) { require_once 'HTML/BBCodeParser.php'; $parser = new HTML_BBCodeParser(parse_ini_file('...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-17-2007
Ronald Wiplinger
 
Posts: n/a
Default BBcode

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:
  • normal
  • bold
  • underline
  • italic
The database field in got these data, but the output on the screen is
also just:
  • normal
  • bold
  • underline
  • italic


What am I doing wrong?

bye

Ronald
Reply With Quote
  #2 (permalink)  
Old 12-17-2007
Ronald Wiplinger
 
Posts: n/a
Default Re: [PHP] BBcode - Solved

I copied BBCodeParse.ini to the wrong place, ....


Ronald Wiplinger wrote:
> 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:
>
  • normal
  • bold
  • underline
  • italic
    >
> The database field in got these data, but the output on the screen is
> also just:
>
  • normal
  • bold
  • underline
  • italic
    >
>
>
> What am I doing wrong?
>
> bye
>
> Ronald
>
>

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:23 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0