[SOLVED] eval() issue

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
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

[SOLVED] eval() issue

Post 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?
sticksys
Forum Commoner
Posts: 33
Joined: Thu Aug 18, 2005 3:23 am
Location: Isreal
Contact:

hi there =]

Post by sticksys »

hi, i'm new here, i think that the problem is that you forgot "}" in the end of the file.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: hi there =]

Post 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 :P Make sure to match up your {'s with your }'s
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post by Fractal »

No.. The {'s and }'s are fine.. Just looked over them again..
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Hmm I'm pretty sure that would be the error. Have you counted your {'s and then counted your }'s ?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post 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
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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;
Last edited by s.dot on Thu Aug 18, 2005 3:53 am, edited 1 time in total.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post by Fractal »

scrotaye wrote:give this a shot

Code: Select all

eval("{$page3['PageSource']};");
// notice the extra ; inside the eval
Didn't change anything. =(
sticksys
Forum Commoner
Posts: 33
Joined: Thu Aug 18, 2005 3:23 am
Location: Isreal
Contact:

Post by sticksys »

eval("{$page3['PageSource']}");
// notice the extra ; inside the eval


try it =]
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post 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>
sticksys
Forum Commoner
Posts: 33
Joined: Thu Aug 18, 2005 3:23 am
Location: Isreal
Contact:

Post by sticksys »

add this:

<?
}
?>

to the end of the file after
</html>

it works..
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I'm really running out of ideas here :P

Perhaps try

Code: Select all

$var = $page3['PageSource'];

eval("\$var");
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Fractal
Forum Commoner
Posts: 54
Joined: Tue Aug 16, 2005 1:28 pm

Post by Fractal »

nvm.. I fixed it.. It was an error in the index file itself.. Not in the db =\
Post Reply