in reply to Escaping special characters for HTML
It couldn't possibly work correctly; you've got all sorts of mismatched quotes. I organized it in a little more readable format, but without changing anything but the use of whitespace, so that it should be easier for you to see that you've completely forgotten to use quotes around text that should be quoted. You may also notice the fact that you've used ',' (comma) where you probably intended to use '.' (concatenation operator) in a few places. ...at least it looks that way to me. Of course you followed up those errors with some more missing quotes, so it's anybody's guess as to the real intent. Here's my reorganized version that hopefully will help you to spot the areas of concern:
$newdiv = '<!-- ADD DIVS -->' . "\n" . div({-style=>"position:absolute;left:" . ($startx+$arealeft) . "px;top:" . ($starty+$areatop) . "px;width:" . $width . "px;height:" . $height . "px;cursor:pointer;" , -onclick=>"Start('$cgiurl?id=$custid');return true;" , -onmouseover=>"this.T_WIDTH=170;this.T_BGCOLOR='#ffffff';ret +urn escape(';"\<center\>\<script language=javascript\>\n"document.wri +te(mystats[" . $imagedetails[0]."]);"\n\</script\>\<br\>";\<img src=\'/cgi- +bin/snapad.cgi?x=" . ($startx+$arealeft) . "&y=".$starty . "&width=" . $width . "&height=" . $height . "&image=1\'\>\</center\>');window.status='$imagedetails[ +1]';shw('$imagedetails[0]-pop',event);return true;",-onmouseout=>"win +dow.status=' ';shw('$imagedetails[0]-pop',event);return true;"},'') . "\n";
You'll need to labor on where it is that you intended to place quotes but forgot. At least this format will make it easier to spot.
You might consider the advantage of HERE documents.
Dave
|
|---|