how to allow HTML tags in php <textarea>

Discussion in 'PHP' started by templates2011, Feb 13, 2012.

  1. #1
    how to allow HTML tags in php <textarea> in wordpress. i have created the function for admin page like custom option but the i failed to maintain it for template main page
     
    templates2011, Feb 13, 2012 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    php.net/htmlspecialchars :)

    Have fun!
     
    EricBruggema, Feb 14, 2012 IP
  3. ankushsharma

    ankushsharma Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Actually the textarea attribute is used when we have to input big field like address of the person in the form..
    <?php
    $text = "This is my webpage: please put any of your details: <textarea>Hello World!</textarea>";
    ?>

    Edit Your Webpage: <textarea id="editPage"><?php echo $text; ?></textarea>
     
    ankushsharma, Feb 17, 2012 IP
  4. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    He didn't need explanation of using textarea, he needs to allow html tags for wp textarea... :confused:
    Try this...
     
    ker, Feb 17, 2012 IP
  5. cuteangeleye

    cuteangeleye Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you're going to use it for wordpress theme admin. Use the following code:

    <textarea name="name of textarea"><?php echo stripslahses($your_variable_or_text);?></textarea>

    This will definitely helps you. :)
     
    cuteangeleye, Feb 17, 2012 IP
  6. templates2011

    templates2011 Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks for the tips
     
    templates2011, Feb 18, 2012 IP