Printing textarea into a textarea

Discussion in 'PHP' started by adamjblakey, Dec 19, 2012.

  1. #1
    I have a database tablet with a row which contains some html e.g.<textarea id="input_51" class="form-textarea" name="q51_otherItems" cols="40" rows="6"></textarea>

    When i try and print this into a text area it is having problems by closing the text area that i am printing this into because i am pasting a textarea into a textarea. Have you ever had this before and if so how did you get over it?

    The purpose is i have a CMS which allows me to put in text and forms etc onto a page using the nicedit wzyiwig but this is causing a problem.

    Cheers,
    Adam
     
    adamjblakey, Dec 19, 2012 IP
  2. jokerhacker

    jokerhacker Member

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    use hmtlentities function
    http://ca3.php.net/manual/en/function.htmlentities.php
    Code (markup):
    An example from php documentation:
    <?php
     $str = "A 'quote' is <b>bold</b>";
    
    // Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
    echo htmlentities($str);
    ?>
    PHP:
     
    jokerhacker, Dec 19, 2012 IP