Page 1 of 1
[SOLVED] eval() issue
Posted: Thu Aug 18, 2005 3:14 am
by Fractal
Parse error: parse error, unexpected $end in C:\Documents and Settings\dkh4658\Desktop\www\ut\index.php(9) : eval()'d code on line 323
But line 323 is the last line of my code which is </html> because it's my template.. And I've already closed the <?php tag before it so it's printing the template.. I was modifying the way my nav and pages worked with a few if statements and the pages table then I was parsed with that... Any idea's?
hi there =]
Posted: Thu Aug 18, 2005 3:26 am
by sticksys
hi, i'm new here, i think that the problem is that you forgot "}" in the end of the file.
Re: hi there =]
Posted: Thu Aug 18, 2005 3:27 am
by s.dot
sticksys wrote:hi, i'm new here, i think that the problem is that you forgot "}" in the end of the file.
Could be anywhere in the file

Make sure to match up your {'s with your }'s
Posted: Thu Aug 18, 2005 3:37 am
by Fractal
No.. The {'s and }'s are fine.. Just looked over them again..
Posted: Thu Aug 18, 2005 3:41 am
by s.dot
Hmm I'm pretty sure that would be the error. Have you counted your {'s and then counted your }'s ?
Posted: Thu Aug 18, 2005 3:44 am
by Fractal
scrotaye wrote:Hmm I'm pretty sure that would be the error. Have you counted your {'s and then counted your }'s ?
No... I matched them up in my editor.
http://www.ut-online.org/index.phps
Posted: Thu Aug 18, 2005 3:45 am
by s.dot
check your eval() statement to see if you're missing a semicolon eval();
Edit: sorry, I didn't see your post above mine
Posted: Thu Aug 18, 2005 3:49 am
by s.dot
give this a shot
Code: Select all
eval("{$page3['PageSource']};");
// notice the extra ; inside the eval
or
$var = eval("return array({$page3});");
extract($var);
echo $PageSource;
Posted: Thu Aug 18, 2005 3:52 am
by Fractal
scrotaye wrote:give this a shot
Code: Select all
eval("{$page3['PageSource']};");
// notice the extra ; inside the eval
Didn't change anything. =(
Posted: Thu Aug 18, 2005 4:00 am
by sticksys
eval("{$page3['PageSource']}");
// notice the extra ; inside the eval
try it =]
Posted: Thu Aug 18, 2005 4:03 am
by Fractal
Parse error: parse error, unexpected $end in C:\Documents and Settings\dkh4658\Desktop\www\ut\index.php(9) : eval()'d code on line 327
Didn't change anything except the line # which is still </html>
Posted: Thu Aug 18, 2005 4:11 am
by sticksys
add this:
<?
}
?>
to the end of the file after
</html>
it works..
Posted: Thu Aug 18, 2005 4:14 am
by s.dot
I'm really running out of ideas here
Perhaps try
Code: Select all
$var = $page3['PageSource'];
eval("\$var");
Posted: Thu Aug 18, 2005 4:31 am
by Fractal
nvm.. I fixed it.. It was an error in the index file itself.. Not in the db =\