Parse HTML code in a textarea

Discussion in 'PHP' started by LindaAdams, Sep 12, 2008.

  1. #1
    I am wanting to show text from a mysql table in a textarea. And in this text area html code will need to be displayed. But right now it only shows it as
    <a href=
    Code (markup):
    is there anyway I can allow HTML to be displayed in a text area? ​

     
    LindaAdams, Sep 12, 2008 IP
  2. SilkySmooth

    SilkySmooth Well-Known Member

    Messages:
    1,583
    Likes Received:
    269
    Best Answers:
    0
    Trophy Points:
    180
    #2
    SilkySmooth, Sep 12, 2008 IP
  3. skimbit

    skimbit Peon

    Messages:
    124
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    use addslashes on the string and it should work
     
    skimbit, Sep 12, 2008 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    Use htmlspecialchars() with ENT_QUOTES parameter. e.g.

    echo htmlspecialchars($text, ENT_QUOTES);
    Code (markup):
     
    mwasif, Sep 12, 2008 IP
  5. LindaAdams

    LindaAdams Active Member

    Messages:
    284
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #5
    maybe I wasnt too clear in what I was asking

    for example I want a <h1> tag to actually make the text bigger.

    I want the <b> to actually make the text bold
     
    LindaAdams, Sep 12, 2008 IP
  6. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #6
    Did you try SilkySmooth's suggestion?
     
    mwasif, Sep 12, 2008 IP
  7. LindaAdams

    LindaAdams Active Member

    Messages:
    284
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #7
    nevermind all!! I found the problem

    I had to go through 30k lines of code and comment out the last 2 lines of:

    case ccsLabel:
    $value=$this->GetText();
    if (!$this->HTML) {
    $value = CCToHTML($value);
    $value = str_replace("\n", "<BR>", $value);



    thanks all for your help, this has been a learning experience for me =)
     
    LindaAdams, Sep 12, 2008 IP