Jump to content

Escaping properly


swampone

Recommended Posts

Im getting a syntax error caused by the first line. How do I properly escape the code?

echo "<tr class="'.$colors[$i++ % 2].'">
	<td align=center  nowrap>($phone1) XXX-$phone2</td>
	<td align=center  nowrap>$overall</td>
	<td align=center  nowrap>$hygiene</td>
	<td align=center  nowrap>$attitude</td>
	<td align=center  nowrap>$ethnicity</td>
	<td align=center  nowrap>$body</td>
	<td align=center  nowrap>$city</td>
	<td align=center  nowrap>$user</td>
	<td align=center  nowrap>$date</td>
	<td align=center  nowrap>$comment</td>
</tr>";

Link to comment
https://forums.phpfreaks.com/topic/212283-escaping-properly/
Share on other sites

This looks like the problem on the first line.

 

echo "<tr class=".$colors[$i++ % 2].">
	<td align=center  nowrap>($phone1) XXX-$phone2</td>
	<td align=center  nowrap>$overall</td>
	<td align=center  nowrap>$hygiene</td>
	<td align=center  nowrap>$attitude</td>
	<td align=center  nowrap>$ethnicity</td>
	<td align=center  nowrap>$body</td>
	<td align=center  nowrap>$city</td>
	<td align=center  nowrap>$user</td>
	<td align=center  nowrap>$date</td>
	<td align=center  nowrap>$comment</td>
</tr>";

Link to comment
https://forums.phpfreaks.com/topic/212283-escaping-properly/#findComment-1106095
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.