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: 340
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!
© Stack Overflow or respective owner