entering html and php into a db and display this in a textarea without it being processed as code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • monomaniac21

    entering html and php into a db and display this in a textarea without it being processed as code

    hi all!

    how can i enter html and php into a db and display this within a
    TEXTAREA without it being processed as code? do i need to replace
    characters like <? with something else like say <..? or is there a more
    elegant solution that tells the php parser etc to ignore this section
    as it needs to be processed as text not code.

    regards

    marc

  • Jerry Stuckle

    #2
    Re: entering html and php into a db and display this in a textareawithout it being processed as code

    monomaniac21 wrote:
    hi all!
    >
    how can i enter html and php into a db and display this within a
    TEXTAREA without it being processed as code? do i need to replace
    characters like <? with something else like say <..? or is there a more
    elegant solution that tells the php parser etc to ignore this section
    as it needs to be processed as text not code.
    >
    regards
    >
    marc
    >
    Before displaying any data like this you should run it through
    htmlentities() to convert chars like "<" to "&lt;". Then it will
    display correctly (and, BTW, not cause the code to be processed).

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    Working...