HTML Escaping

From: Date: Fri, 23 Jul 2004 18:07:39 +0000
Subject: HTML Escaping
Groups: php.general 
Request: Send a blank email to php-general+get-191669@lists.php.net to get a copy of this message
I've got a conditional button that needs to appear/hide on my page depending upon the contents of a field in my database. The button is an image and has a long URL and JavaScript for image rotation attached to it. Needless to say, the href is quite long and includes several "'" characters. My conditional works great but I want to know if there is an easy way to escape the whole href so that the "'" characters will not be seen as PHP quote marks. See below... <?php if ($recordset['field'] != "1") { echo '<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('PreviousPage','','/URL/ButtonName.gif',1)"><img src="/URL/ButtonName.gif" alt="Previous Page" name="Previous Page" width="150" height="20" border="0"></a>; ?> Thanx in advance, Robb -- Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams ---------------------------------------------------- http://www.digitaliguana.com http://www.cancerreallysucks.org

« previous php.general (#191669) next »