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 Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
sasa Posted October 22, 2006 Share Posted October 22, 2006 use htmlentities() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.