I'm really was struggling the last few days on this problem. And I'd really appreciate some help. I'm working at the moment on a blog for a local politician in my town. It's basically the first time im developing in php, so please dont judge me. And here comes my problem: My mate wants to publish news and blogs on his homepage. So I created a little CMS in php to help him do this. It is all working perfectly except for the editing part. My problems with editing are:
- If he wants some formatting I found the nl2br() method really helpful, but when editing a second time the same blog-entry it is doubling all the <br> tags in the text. Do you guys have any idea how I could do this smoother?
- The next problem lies in publishing links. If he is trying to include links in his blogs with normal HTML tags (<a href="..."></a>) SQL always comes up with an error because of wrong syntax. So I used mysqli_real_escape_string() to prevent this. But instead of fixing the problem it just made a question marks infront of all special characters.
If there is anybody who could help me a little bit, I would really appreciate it! Thank you guys.