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
ridwan
Forum Commoner
Posts: 55 Joined: Thu Aug 22, 2002 3:15 am
Post
by ridwan » Thu Feb 20, 2003 1:47 am
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 » Thu Feb 20, 2003 8:58 am
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 » Fri Feb 21, 2003 3:15 am
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>
<?
}
}
//if no records present
//display message
else
{
echo "<font size='-1'>No press release currently available.</font> ";
}
//close database connection
mysql_close($db);
echo "</td> </tr> </table>" ;
break;
}
?>
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Fri Feb 21, 2003 3:49 am
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 » Fri Feb 21, 2003 4:14 am
i checked and everything seems in order; but does anyone know why it completely works on server 2k but not on linux ??????