harkly Posted December 29, 2008 Share Posted December 29, 2008 I just added my alt tags for my images and it only gives it the first word. Is there a way to do the whole thing?? <td><a href='image.php?imgid=$r[imgid]' title=$title class=thickbox><img src='image/thumb/$artid/$imgid' border=0 align=left width=75 alt=$title></a></td><td valign=top><i>".$title."</i> Link to comment https://forums.phpfreaks.com/topic/138680-solved-php-and-alt-tags/ Share on other sites More sharing options...
opalelement Posted December 29, 2008 Share Posted December 29, 2008 <a href='image.php?imgid=$r[imgid]' title=$title class=thickbox> <img src='image/thumb/$artid/$imgid' border=0 align=left width=75 alt=$title> In that code, lets say the $title is "A phrase with spaces" This means that the code output to the browser is like this: <a href='image.php?imgid=$r[imgid]' title=A phrase with spaces class=thickbox> <img src='image/thumb/$artid/$imgid' border=0 align=left width=75 alt=A phrase with spaces> It then considers these as the properties: A: title = a phrase with spaces IMG: alt = a phrase with spaces It thinks of "phrase", "with", and "spaces" as properties such as that on a select element you can set "<option ... selected>" or a checkbox can have checked written in it. That is a long way to say add quotes around $title in both lines. Link to comment https://forums.phpfreaks.com/topic/138680-solved-php-and-alt-tags/#findComment-725068 Share on other sites More sharing options...
harkly Posted December 29, 2008 Author Share Posted December 29, 2008 Thanks!! The explanation really helps to understand it in more detail! Link to comment https://forums.phpfreaks.com/topic/138680-solved-php-and-alt-tags/#findComment-725104 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.