escaping quotes

Hey guys, I am having some trouble with php code. Here is the code:

[php]echo “<tr height=“10px” onmouseover=“ChangeColor(this, true);”
onmouseout=“ChangeColor(this, false);”
onclick=“location.href = ‘http://www.bet-central.com/SITETESTING/page2.php?name=’.$row[‘casinoname’].’’;”>”;
[/php]

The problem occurs in the final part in the href where a db entry is used in part of the URL. My problem is the multiple use of ',"," etc. There are just too many of them. I would really appreciate some help.

Thanks

I personally find it better to use single quotes for most echo statements:

echo '<tr height="10px" onmouseover="ChangeColor(this, true);" onmouseout="ChangeColor(this, false);" onclick="location.href = \'http://www.bet-central.com/SITETESTING/page2.php?name='.$row['casinoname'].'\';">';

This allows regular speech mark usage, with the only escaped characters being the single quotes around the location.href string.

Sponsor our Newsletter | Privacy Policy | Terms of Service