ahallicks
01-20-2008, 08:09 PM
Firstly, I would like to iterate that I'm very much new to php so I don't know many of the functions etc. I have built a little CMS for my site that allows members to post blogs and add them to the database. Then they are listed and the clients can view them if they click the right link... general stuff.
I'm curious about how the actual 'code' behind the blogs is output. I'm currently using nl2br to keep the line spaces in, but because everything else in the site is supposed to be semantic and 'properly' coded, I would like to apply this to the articles to. So, for example, rather than having two line breaks after each paragraph I would like the paragraphs to be wrapped in <p> tags so they look as my paragraphs should and I'm not having to use any horrible <br /> tags.
Is this possible, and if so how? And would it be done when the blog is added to the database, or upon return.
Also, on a side note, could someone quickly explain to me what exactly mysql_real_escape_string actually does, or what text it affects? Could I use it for this type of database input?
Thanks guys
I'm curious about how the actual 'code' behind the blogs is output. I'm currently using nl2br to keep the line spaces in, but because everything else in the site is supposed to be semantic and 'properly' coded, I would like to apply this to the articles to. So, for example, rather than having two line breaks after each paragraph I would like the paragraphs to be wrapped in <p> tags so they look as my paragraphs should and I'm not having to use any horrible <br /> tags.
Is this possible, and if so how? And would it be done when the blog is added to the database, or upon return.
Also, on a side note, could someone quickly explain to me what exactly mysql_real_escape_string actually does, or what text it affects? Could I use it for this type of database input?
Thanks guys