on my site i have this snippet of code in php
[CODE]
if($width < 1024 && $height < 768){
echo “function loadPicture(pictureName, picAlt)
{ winId = window.open(”,’newwin’,’width=530,height=420′);
winId.document.write(‘<body bgcolor=”black” onLoad=”if (window.focus) window.focus()”><center>’);
winId.document.write(‘<img src=”‘ + pictureName + ‘”>’);
winId.document.write(‘</center><center><font size=”2″ color=”white”>’ + picAlt);
winId.document.write(‘</font></center></body>’);
winId.document.close();
}”;
}
and then later i call the function
[CODE]
if($width >= 1024 && $height >= 768)
echo “<a href=””.$PHP_SELF.”?width=”.$width.”&height=”.$height.”&type=”.$type.”&offset=”.$offset.”&pic=”.$PICSRC.”” target=”_self”>”;
else
echo “<a href=”JavaScript:loadPicture(‘”.$PICSRC.”‘,'”.$PICALT.”‘)”>”;
the part where i have a problem is in the else clause in the second snippet of code. it all works fine, unless $PICALT has an apostrophe in the sentence. if it does, it ****s up the rest of the loadPicture(,) function. really what i just need is a way to tell the browser to ignore any apostrophes within $PICALT. i’m sure its really simple and this was an insanely long winded way of asking it, but i’d appreciate the help. sorry for the php, but it shouldn’t affect the answer to my question any. thanks again