swampone Posted September 1, 2010 Share Posted September 1, 2010 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 More sharing options...
petroz Posted September 1, 2010 Share Posted September 1, 2010 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 More sharing options...
swampone Posted September 1, 2010 Author Share Posted September 1, 2010 I knew it was something simple. Thanks a bunch!!! Link to comment https://forums.phpfreaks.com/topic/212283-escaping-properly/#findComment-1106099 Share on other sites More sharing options...
petroz Posted September 1, 2010 Share Posted September 1, 2010 I think your gonna need todo the same thing on each line.... Link to comment https://forums.phpfreaks.com/topic/212283-escaping-properly/#findComment-1106103 Share on other sites More sharing options...
swampone Posted September 1, 2010 Author Share Posted September 1, 2010 Naw, the one line solved everything Link to comment https://forums.phpfreaks.com/topic/212283-escaping-properly/#findComment-1106136 Share on other sites More sharing options...
petroz Posted September 1, 2010 Share Posted September 1, 2010 Great! Link to comment https://forums.phpfreaks.com/topic/212283-escaping-properly/#findComment-1106137 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.