Snopzer
Snopzer

Reputation: 1702

Show Editor Content in HTML page

I am using Editor to change the Code Design, But when I retrieve the Code using PHP, it disturbing the Complete page Design.

<p><?php echo substr($postData['short_description'],0,POST_DESCRIPTION_LENGTH); ?>....<a href="<?php echo SITEURL?><?php echo $postData['seo_url']?>">Read More.</a></p>

How can i resolve this.?

Upvotes: 0

Views: 115

Answers (1)

Henrik
Henrik

Reputation: 189

It could be that the data your are getting through the $postData variable has html elements in it. You should wrap it with the method htmlspecialchars() to sanitize it. This will also protect you from possible XXS-attacks.

Upvotes: 1

Related Questions