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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ridwan
Forum Commoner
Posts: 55
Joined: Thu Aug 22, 2002 3:15 am

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

Post 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.
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

can you post what that line is and even several lines before and after it. That may help us.
ridwan
Forum Commoner
Posts: 55
Joined: Thu Aug 22, 2002 3:15 am

Post 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;

?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Check that all braces ({ }) are correct - when you are moving in and out of PHP they can get confused.

Mac
ridwan
Forum Commoner
Posts: 55
Joined: Thu Aug 22, 2002 3:15 am

Post by ridwan »

i checked and everything seems in order; but does anyone know why it completely works on server 2k but not on linux ?????? :?
Post Reply