paperplane Posted November 13, 2010 Share Posted November 13, 2010 Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING $listhtml .= "<a href=\"$latest['cat_title']/$latest[haha]\" title=\"Details for $latest[haha]\">$latest[haha] ($date)</a>\n"; so this is the line it says this error is originating from. I dont know any php..if anyoen can help that would be great. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/218533-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-please-help/ Share on other sites More sharing options...
DavidAM Posted November 13, 2010 Share Posted November 13, 2010 A lot of times, that error is the result of a problem one or two lines before the number it reports. Post more of your code -- use the code tags (it's the button with the hash mark '#' on it or the one that says PHP) so it is easier to read. Quote Link to comment https://forums.phpfreaks.com/topic/218533-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-please-help/#findComment-1133682 Share on other sites More sharing options...
mikecampbell Posted November 15, 2010 Share Posted November 15, 2010 Put your variables in curly brackets -- $listhtml .= "<a href=\"{$latest['cat_title']}/ ... Quote Link to comment https://forums.phpfreaks.com/topic/218533-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-please-help/#findComment-1134284 Share on other sites More sharing options...
TrueColors Posted November 15, 2010 Share Posted November 15, 2010 or $listhtml .= '<a href="' . $latest['cat_title'] . '/' . $latest[haha] . '" title="Details for ' . $latest[haha] . '">' . $latest[haha] . ' (' . $date . ')</a>\n'; Quote Link to comment https://forums.phpfreaks.com/topic/218533-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-please-help/#findComment-1134300 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.