Soulhunter74 Posted October 22, 2006 Share Posted October 22, 2006 Hi,I've got the following problem. An item in my DB has a value like this: The carpenter's roof.With my current coding the web page only displays: The carpenterMy coding: ***echo "<a href='projets_encours_details.php?ID=$row[2]'><img src='images/home/$row[0]' border='0' class='homeThumb' alt='projet en cours' title='$row[3] $row[4] (début étude: $row[5])' width='200' height='80' /></a><br>$row[1]";***The problem seems to be with the 'title=' part. It seems like the code interprets the ' as marking the end of the string. How do I correct this?Thanks a lot!Jerome Link to comment https://forums.phpfreaks.com/topic/24738-displaying-not-entering-apostrophes/ Share on other sites More sharing options...
alpine Posted October 22, 2006 Share Posted October 22, 2006 Use double quotes in your html instead of single quotes:[code]<?phpecho <<<_HTML<a href="projets_encours_details.php?ID={$row[2]}"><img src="images/home/{$row[0]}" border="0" class="homeThumb" alt="projet en cours" title="{$row[3]} {$row[4]} (début étude: {$row[5]})" width="200" height="80" />< /a>{$row[1]}_HTML;// Or escape them in normal echoecho "<a href=\"projets_encours_details.php?ID=$row[2]\"><img src=\"images/home/$row[0]\" border=\"0\" class=\"homeThumb\" alt=\"projet en cours\" title=\"$row[3] $row[4] (début étude: $row[5])\" width=\"200\" height=\"80\" />< /a>$row[1]";?>[/code] Link to comment https://forums.phpfreaks.com/topic/24738-displaying-not-entering-apostrophes/#findComment-112655 Share on other sites More sharing options...
sasa Posted October 22, 2006 Share Posted October 22, 2006 use htmlentities() Link to comment https://forums.phpfreaks.com/topic/24738-displaying-not-entering-apostrophes/#findComment-112658 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.