Changed htmlentities() to htmlspecialchars().