View Full Version : Adding A Line Break <br> And Denying Other HTML Code

07-16-2012, 01:54 AM
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

07-16-2012, 06:41 AM
strip_tags() is good for this, you can pass in a list of allowed tags.


07-17-2012, 03:03 AM
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.


07-17-2012, 03:32 AM
So could you use (str_tags($_POST['value'])):

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

07-26-2012, 12:34 PM
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!