I'm writing a little plugin for WordPress, which is used to create new entry's in a Notebook (also written in PHP, but not as a Plugin for WordPress). The Plugin should only create, edit and delete entry's from the Notebook (so I don't need to write a back end myself).
For the Editor, i use TinyMCE from WordPress (with the wp_tiny_mce()-function). I also use the $wpdb->prepare() function from WP to write the created entry in the Database. But the result in the Database is something like this:
Quote
<p style=\"text-align: center;\">Ich bin Zentriert</p>
As you can see, escaped HTML-Code is stored in the Database and I have no idea why. I only use the prepare() Function from WP (which is used to escape code) and than store it in the Database.
I first thought, Magic Quotes would maybe the Problem, but Magic Quotes isn't activated at all.
The code look's like this:
global $wpdb;
$wpdb->show_errors();
// Query erstellen:
$sql = 'INSERT INTO bb_eintrag (headline, datum, preview, inhalt) VALUES
(%s, NOW(), %s, %s)';
if (!$wpdb->query(
$wpdb->prepare($sql, $_POST['headline'], $_POST['preview'], $_POST['inhalt'])
)){
exit("<p>Eintrag konnte nicht erstellt werden!</p>");
}
What am I missing?
Greetings: Luke

New Topic/Question
Reply



MultiQuote





|