Jump to content

Problem with bbcode input


SirChick

Recommended Posts

I have a textarea which is meant to echo the text with bbcode but it is not working...  i got this error:

 

 

<b>Fatal error</b>:  Call to undefined function  bbcode_format() in <b>C:\xampp\htdocs\pendingreports.php</b> on line <b>80</b>

 

This is what i got for the input of the text:

<?php
$Notes =  mysql_real_escape_string($_POST['TextArea1']);
function bbcode_format($Notes){
$Notes = htmlentities($Notes);
$simple_search = array(
                                '/\[b\](.*?)\[\/b\]/is'
                                );

        $simple_replace = array(
                                '<strong>$1</strong>'
                                );

        // Do simple BBCode's
        $Notes = preg_replace ($simple_search, $simple_replace, $Notes);

        return $Notes;
}
If($Notes == ''){
Header("pendingreports.php");
}Else{
	$UPDATE = mysql_query("UPDATE reportedusers SET StaffNotes='$Notes' WHERE RecordID='$RecordID'")
	or die(mysql_error());
	Header("location: pendingreports.php?view=$RecordID");
}
?>

 

 

Then i echo it here:

 

<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:67px;top:31px;width:325px;height:254px;z-index:0" rows="14" cols="33">
<?php=bbcode_format($Notes);?></textarea>

 

Link to comment
Share on other sites

Well i presumed u knew as you were helping fix my problem..some one else gave me this function to use but i don't know if its meant to be used before the input to the database or only on the output of an echo. Or both.

 

How ever it didn't work just to add the error no longer appears but the echo comes out blank.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.