Correct sequence of actions when using Markdown & MySQL?
- by Andrew Heath
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
user input via HTML form using Markdown syntax
$queryInput = mysql_real_escape_string($userInput);
insert sanitized string into database
OUTPUT
query field from database
$output = Markdown($queryResult);
display $output
Is that it?
Does PHP Markdown preclude the need for htmlspecialchars or Pure HTML ?
Thanks!