Correct sequence of actions when using Markdown & MySQL?

Posted by Andrew Heath on Stack Overflow See other posts from Stack Overflow or by Andrew Heath
Published on 2010-05-04T10:09:51Z Indexed on 2010/05/04 10:28 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

I want my users to be able to write an article in Markdown, have it stored in the MySQL database (with the option to edit it in the future), and displayed for other users.

In practice, this is my understanding of how it works:

INPUT

  1. user input via HTML form using Markdown syntax
  2. $queryInput = mysql_real_escape_string($userInput);
  3. insert sanitized string into database

OUTPUT

  1. query field from database
  2. $output = Markdown($queryResult);
  3. display $output

Is that it?

Does PHP Markdown preclude the need for htmlspecialchars or Pure HTML ?

Thanks!

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sanitization