Hooch Posted November 4, 2007 Share Posted November 4, 2007 Hello all. I have the code working except when the text has quotes. Here is the code... <a href="art2.php?id=<?PHP echo $r['id']?>"><img src="images/items/<?PHP echo $r['gallery_id']?>-T.jpg" alt="<?PHP echo stripslashes($r['title'])?>" width="118" height="118" border="0" class="pic-border" style="background-color: #869AA1" /> I thought this would work... alt="<?PHP echo stripslashes($r['title'])?>" There are about 20 pictures on this page and all have text when I hover except the 1. The text that does not show is as follows... "Gros Mourne" Nfdl. BTW this is coded for IE (Customer request) Hooch Link to comment Share on other sites More sharing options...
boen_robot Posted November 4, 2007 Share Posted November 4, 2007 You mean that $r['title] can have quotes? Well, in that case, simply escape them to entities like so: alt="<?PHP echo htmlspecialchars(stripslashes($r['title']),ENT_QUOTES)?>" (with this, you're also safely escaping "<", ">" and "&" btw) Link to comment Share on other sites More sharing options...
Hooch Posted November 5, 2007 Author Share Posted November 5, 2007 Worked like a charm. Thank you very much Link to comment Share on other sites More sharing options...
jlhaslip Posted November 5, 2007 Share Posted November 5, 2007 Hooch,Toolips Tutorial here: http://jlhaslip.com/samples/tooltips/ Link to comment Share on other sites More sharing options...
Hooch Posted November 6, 2007 Author Share Posted November 6, 2007 Thanks jlhaslip nice tut. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.