Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Adding A Line Break <br> And Denying Other HTML Code

    I got the errors outputing by adding else statements with {
    }

    Wondering if there's a function that will detect both <td> & <br> so if i added a extra space it can detect this.
    I look on google tommorow when I get home from work & school (Home now but weekday tomorrow)

    Seen it somewhere before but carnt remember where, How do I stop code from being added...
    (Except <br> & <td>)

    PS: Seen Many sites where the <br> Is hidden but it still does the break sounds relistic
    how is that possible?
    There my last questions And I can do the rest my self & buy
    PHP Books..

    Please Reply.
    Thanks for the help

    I would post the code but dont have access to it at the momment since im at work but im currently using the nbl2r($_POST['value']): Function... any other things that can be used
    Last edited by Spudster; 07-16-2012 at 01:59 AM.

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Location
    Spokane, WA
    Posts
    148
    Thanks
    4
    Thanked 4 Times in 4 Posts
    strip_tags() is good for this, you can pass in a list of allowed tags.

    http://php.net/manual/en/function.strip-tags.php

  • Users who have thanked RyanB88 for this post:

    Spudster (07-17-2012)

  • #3
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Thanks This has helped me

    i am just a few months into coding/PHP.

    I made one other thread about another issue im trying to work out should be my last.

    http://www.codingforums.com/showthread.php?t=268050

  • #4
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    So could you use (str_tags($_POST['value'])):

    Havent tried it yet since im at school then i have work.

  • #5
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok, Sorry been busy ofer the past few days..

    Anyway that doesn't work? Try to explain better.

    I want it to make a new line break when the user

    Starts a break like this But when it posts threw it only displays <br/> in the text field/when a user edits the data/info like posts.
    im using nl2br function in like this nl2br($_POST['value']);
    how can i stop the <br/> from echoing?? like Vbulletin (this forums software) And other sites..
    Ive looked all over google still stumbed!
    Last edited by Spudster; 07-26-2012 at 12:40 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •