I have the following code to pull data from mysql:
Code: Select all
<input type="text" name="title" value="<?php echo addslashes get_option('title'); ?>" />
which is fine until I use quotes, such as:
Code: Select all
This <span class="bannertitle">Title</span>
I tried escaping it with addslashes, but it still breaks the page that the data is displayed on. (It's displayed in an admin page within Wordpress, but it works fine where the data is used on the front end.) This is the code output in the admin page:
Code: Select all
<input type="text" name="title" value="This<span class="bannertitle">Title</span>" />
Which looks like this:
How can I fix this?