PHP parse error unexpected $end
Posted: Wed Apr 27, 2011 6:17 pm
Hi, first post here, thanks for looking
I was getting an error in PHP whereby I had written some PHP code for page content into my database when queried to the relevent page the php wasn't working. To get round this I used
which worked fabulously on WAMP, so I went on my merry way building my site. I then uploaded all the files on a web server, created the same table etc and now all I get is an error
[text]Parse error: syntax error, unexpected $end in /home/server/public_html/thesite/index.php(43) : eval()'d code on line 4[/text]
If I remove the eval code bit and echo the $page_content the error goes but none of the php within the content taken from the database works, it's just written as undisplayed text on the source. I've checked for missing braces, brackets, parenthesis etc as well as semicolons, double quotes and single quotes.....none seem present and this did work flawlessly on WAMP.
Is there any other way round this?
I was getting an error in PHP whereby I had written some PHP code for page content into my database when queried to the relevent page the php wasn't working. To get round this I used
Code: Select all
<?php eval('?>'.$page_content.'<?php'); ?>[text]Parse error: syntax error, unexpected $end in /home/server/public_html/thesite/index.php(43) : eval()'d code on line 4[/text]
If I remove the eval code bit and echo the $page_content the error goes but none of the php within the content taken from the database works, it's just written as undisplayed text on the source. I've checked for missing braces, brackets, parenthesis etc as well as semicolons, double quotes and single quotes.....none seem present and this did work flawlessly on WAMP.
Is there any other way round this?