Solutions forum

Subscribe to posts

Forum » Website Development » PHP error - unexpected $end

I'm new to this forum - but I stumbled across it and I have a PHP syntax error.

It says unexpected $end in file ..... on line 81.

What does the unexpected $end mean?
Ah, just had another error as well...

Warning: main(/functions/common.php) [function.main]: failed to open stream: No such file or directory in ..... on line 8

I've just added the file, and it's in the correct directory, what's wrong?
The unexpected $end error occurs when you have a function open.

Say you have an IF statement, you open the curly brackets {

You also need to remember to close the curly brackets }

Although it tells you the error is on 81, it might not be. Line 81 will be the last line of code, the IF statement, PHP switch, or function may be half way up your page.

Just go through and make sure they're all closed.

As for the include not working, take off the leading forward slash / and put the link as a relative link. If it still doesn't work then check the file to include has been uploaded to the correct directory.
Brilliant, thanks for replying both my questions so promptly. Any further questions and I'll know where to come :)

Latest activity

Latest member: stheshot

Latest category: Software compatibility

Latest topic: slow internet in Slow Computer

Latest post by Peter Nichol on Variables not shown in Website Development

Networks

Share this on Facebook  Google  Yahoo  Technorati  Reddit  Digg  del.icio.us