Amezis 0 Report post Posted December 30, 2005 I am getting this message when testing a script I made: Parse error: parse error, unexpected $ in /home/globa38/public_html/forum/mods/phpbb_fetch_all/news/forumnews.php on line 159On line 159, which is the last line in that file, I can only see this:?> What's the problem, and how can I fix it? Share this post Link to post Share on other sites
sxyloverboy 0 Report post Posted December 30, 2005 can you post codelines 150 - 170? that would give some more insight on this problem. Share this post Link to post Share on other sites
Amezis 0 Report post Posted December 30, 2005 <?for ($i = 0; $i < count($news); $i++) {{$max_length = 27;$title = ($news[$i]['topic_title']);$title_length = strlen($title);if ($title_length > $max_length){$title = substr_replace($title, '...', $max_length);}?> <tr> <td class="newshover"> <?php echo append_sid('http://forum.global-rs.com/viewtopic.php?t=' . $news[$i]['topic_id']); ?>"> <?php echo date('d-M-Y',$news[$i]['post_time']); ?> - <?php echo($title); ?></a></td> <tr><?php}?> Share this post Link to post Share on other sites
sxyloverboy 0 Report post Posted December 30, 2005 hmm idunnomaybe you can try this:change <?php echo date('d-M-Y',$news[$i]['post_time']); ?> - <?php echo($title); ?></a></td> to:<?php echo date('d-M-Y',$news[$i]['post_time']); ?> - <?php echo $title; ?></a></td> Share this post Link to post Share on other sites
rvalkass 5 Report post Posted December 30, 2005 As far as I can see you have some extra braces. You have one extra { at the beginning that is never closed. Also, try not to break out of PHP into HTML in the middle of a for loop, as it can sometimes cause problems. Just put each line as an echo. Share this post Link to post Share on other sites
Amezis 0 Report post Posted December 30, 2005 Okay, I have changed the code as you said, sxyloverboy, and I have put the HTML code in echo(). But still, the problem is happening. Share this post Link to post Share on other sites
sxyloverboy 0 Report post Posted December 30, 2005 hm looking at this thread i see that the problem was a curly brace "{" that wasnt closed. look though all of your code to see if you find something that you havent closed. if that dosent help i dunno. Share this post Link to post Share on other sites
beeseven 0 Report post Posted January 7, 2006 When it says that there's an unexpected $ on the last line of the file, that always means that you didn't close all of your curly braces ( { ). Share this post Link to post Share on other sites