Re: saved html in mysql db displays as plain text when retrieved

  •  09-06-2010, 1:42 PM

    Re: saved html in mysql db displays as plain text when retrieved

    I found the problem:
     
    The display function I was using contains two sub functions that are normally needed to display text in my web pages.
     
    function forDisplay( $text ) {
      $text = htmlentities( $text );
      $text = nl2br( $text );
      return $text;
    }
    I removed this display function that formats the field data.
     
    Before:
     
    $note = forDisplay( fromStorage( $row[2] ) );
     
    After (I removed the "forDisplay" wrapping function):
     
    $note = fromStorage( $row[2] )
     
    I used to php code years ago, so my code may look antiquated (in fact I've never used OOP PHP code!)
     
    The webpage now looks correct using the CuteEditor stored html.
     
     
     
View Complete Thread