I'm making a mini social-network type site, where poeple can submit questions/chat things to a php page, which adds that data to a database, then gets all the data from the database and puts it in its own div on the page, displaying all the comments. The only problem is that people are submitting tags which are messing up the page, and I was wondering if there was a way to disable <> tags in a specific div? Here's the seciton of code for that part:
$q=mysql_query("SELECT * FROM posts WHERE user='$u' ORDER BY date DESC");
?>
<div class="posts">
<?php
if(mysql_num_rows($q)<1)
{
echo "{$u} has not submitted any updates yet.";
} else {
while($row=mysql_fetch_array($q))
{
$com=$row['post'];
?>
<div class="comment">
<p><?php echo $com; ?></p>
<div class="user_post">
<a href="/user.php?u=<?php echo $u; ?>" class="usersname"><p class="comtext"><?php echo $u; ?></p><img src="/user/Coby/background.png" style="display:block; width:50px; margin-top:-20px; height: auto !important; background-image: url('<?php echo $avatar; ?>'); background-size: cover;" ></img></a></div>
</div>
<?php
}
}
if($isOwner=="yes") { ?>
<form action="post.php" method="post">
<input type="hidden" name="user" value="<?php echo $u; ?>" />
<textarea placeholder="Write on your Corner!" name="comment"></textarea>
<input type="submit" value="Post!" name="submit" />
</form>
<?php } ?>
</div>
</div>