Parse error: syntax error, unexpected $end in /var/www/www.greenopolis.com/htdocs/includes/common.inc(1355) : eval()'d code on line 11

can any one help me on this

Comments

Heine’s picture

There's most likely a PHP node or block (or code for block visibility) that contains code with a syntax error. Go into the db to disable the block / correct the code.

See also http://drupal.org/node/85694 and http://drupal.org/node/166556

drup_lr’s picture

Title: Parse error: syntax error, unexpected $end in /var/www/www.greenopolis.com/htdocs/includes/common.inc(1355) : eval()'d code on l » Parse error: syntax error, unexpected $end in common.inc(1355) : eval()'d code on l

but there are no syntax errors.

Heine’s picture

1. The code in common.inc is syntax error free. The code with the syntax error (line 11) is something that is passed to drupal_eval (replace eval() with error_log($code) and you'll see what gets executed.

2. If you want support on the syntax error, consider pasting the code.

drup_lr’s picture

This is my code . can you help in finding the error

<?php

global $user;
if($user->uid>0)
{

echo("Dear <b> ".$user->name."  </b> ");
echo("Please access the resouces ONLY available to Registered  users");
?>
<p align="justify">
<b>which is a 50% discount from the regular price. </p>
<?php
}
else
{
echo("Dear <b> Guest </b> ");
?>
<p align="justify">
Please <a href="user/register">Register</a> or<a href="user"> Login</a> to take advantage of this offer and access the resouces ONLY available to registered users</p>
<?php
}
?>
Heine’s picture

Is this the code that is printed to the PHP error log?

drup_lr’s picture

my code in the node

Heine’s picture

Replace eval(...) with error_log($code) and you'll see what gets executed.

drup_lr’s picture

I get this

[05-Mar-2009 11:12:02]


global $user;
if($user->uid>0)
{

echo("Dear <b> ".$user->name."  </b> ");
echo("Please access the resouces ONLY available to Registered  users");

which is a 50% discount from the regular price.

}
else
{
echo("Dear <b> Guest </b> ");

Please Register or Login to take advantage of this offer and access the resouces ONLY available to registered users

}
drup_lr’s picture

Title: Parse error: syntax error, unexpected $end in common.inc(1355) : eval()'d code on l » Parse error: syntax error, unexpected $end
mdupont’s picture

Status: Active » Closed (cannot reproduce)

Closing old issue.