Associate
- Joined
- 21 Sep 2007
- Posts
- 453
Me again, this time with another problem I'm sure is super easy for you php eggheads to fix!
I have included the nl2br function on my add and edit pages, so the user doesnt have to use code to make new lines/breaks, its done for them.
Working nicely when i add a new article, yet when I goto edit an article, and update it, the code adds in the breaks again where the old ones are, doubling them up. If i edit it again, it would add the breaks a third time next to the original ones.
i.e.
Original article:
This would look like:
if i edit it to read:
it would end up:
So firstly how can i stop it doing this? and Secondly, can I make it so when editing an article, the <br /> do not show up in the text box?
Thanks once again!
I have included the nl2br function on my add and edit pages, so the user doesnt have to use code to make new lines/breaks, its done for them.
Working nicely when i add a new article, yet when I goto edit an article, and update it, the code adds in the breaks again where the old ones are, doubling them up. If i edit it again, it would add the breaks a third time next to the original ones.
i.e.
Original article:
Code:
Hello
There
This would look like:
Code:
Hello<br />
<br />
There
if i edit it to read:
Code:
Hello
There
People!
it would end up:
Code:
Hello<br />
<br /><br /><br />
There<br />
<br />
People!
So firstly how can i stop it doing this? and Secondly, can I make it so when editing an article, the <br /> do not show up in the text box?
Thanks once again!