Page 1 of 1

parse php error in linux/apache but fine on win2k/apache

Posted: Thu Feb 20, 2003 1:47 am
by ridwan
I am receiving the folowing error when I run my code on a machine with linux and apache:

Code: Select all

Parse error: parse error, unexpected $ in /var/www/html/mecer.co.za/news/intro_page_chooser.php on line 175
but on my machine running win2k and apache I get no error at all it is reffering to the last line of code which is '?>' so I am not to sure why I'm getting it.

Posted: Thu Feb 20, 2003 8:58 am
by oldtimer
can you post what that line is and even several lines before and after it. That may help us.

Posted: Fri Feb 21, 2003 3:15 am
by ridwan
This is a few lines before it after the error there is nothing:

Code: Select all

<li><b><a href="main_intro.php?id=
<? echo $row->contentid . "&pagetype=news" ?>
">
<font color="#69B92E"><? echo nl2br(substr($row->body,0 ,70)); ?>
.....</font></a>
</b>
<br>
<? echo $row->date; ?></li> <br><br>
<?
&#125;
&#125;
//if no records present
//display message
else
&#123;

echo "<font size='-1'>No press release currently available.</font> ";
&#125;
//close database connection
mysql_close($db);
echo "</td>    </tr>    </table>" ;
break;
&#125;

?>

Posted: Fri Feb 21, 2003 3:49 am
by twigletmac
Check that all braces ({ }) are correct - when you are moving in and out of PHP they can get confused.

Mac

Posted: Fri Feb 21, 2003 4:14 am
by ridwan
i checked and everything seems in order; but does anyone know why it completely works on server 2k but not on linux ?????? :?