Forum Moderators: coopster

Message Too Old, No Replies

T_STRING Error Frustration

         

koss911

12:09 pm on Jul 30, 2005 (gmt 0)

10+ Year Member



I got this to work at one time now it's tossing T_STRING errors at me:

Line in Question:
$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+¦(?R)))*)\<))#se', "@preg_replace('#\b(" . str_replace('\\', '\\\\', addslashes($highlight_match)) . )\b#i, '<span style="color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $message . '<'), 1, -1));

I'm at my wits end with this.

koss911

12:38 pm on Jul 30, 2005 (gmt 0)

10+ Year Member



^ Figured that last one out.
My trouble's haven't ended though. Another error has appeared:

Line:
$poster_avatar = '<img src="' . append_sid("avatar.php?action=view&user_id=' . $postrow[$i]['user_id']) . '" alt='' . $postrow[$i]['username'] . '\'s Character" border="0" />';

I have no clue on this one...

jatar_k

3:05 pm on Jul 30, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld koss911

I am guessing that is also a parse error as you neglected to mention it but

in the line you posted your quotes don't match, they should be double or single but you seem to have a combination of both

ergophobe

4:29 pm on Jul 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As a general comment on debugging, if you get an error like that

1. Insert a "dummy" line above the one that shows the error. Something like

$dummy_var = 0;

This does nothing, but if the error then appears on *that* line, you know that the actual error is upstream in a missing quote (usually) or missing ; or ) etc.

2. Now that you know you're on the right line, break it down into component parts.

$id = $postrow[$i]['user_id'];
$source = append_sid("avatar.php?action=view&user_id=' . $id);
$alt = $postrow[$i]['username'];
$poster_avatar = '<img src="' . $source . '" alt='' . $alt . '\'s Character" border="0" />';

Now it will be clear where the errors are and you can work on them one at a time.