| Author |
php syntax problem - need help
|
|
| leegold 2006-01-22, 3:56 am |
| given I have in main.php :
<?php
require_once 'breadcrumbs.php';
?>
and in breadcrumbs.php I have:
<?
class breadcrumb {
echo '1234';
}
?>
I get an error message:
Parse error: parse error, unexpected T_ECHO, expecting T_OLD_FUNCTION or
T_FUNCTION or T_VAR or '}' in
/mnt/web_j/d02/s44/a00071yw/www/breadcrumbs.php on line 3
I'm doing this on my remote host. breadcrumbs.php is in the same dir as
main.php.
What could the problem be?
Thanks
| |
| goldtech@worldpost.com 2006-01-22, 3:56 am |
| Sorry I realize i need the {....} but not class breadcrumb cause i'm
not doing OOP - just the {...} and it works now.
Sorry to bother...
| |
| rlee0001 2006-01-22, 3:56 am |
| You don't need the braces either. Just the echo statement itself.
-Robert
| |
| Ken Chau 2006-01-23, 3:55 am |
| that's just the oddest thing... if you're trying to require_once a PHP
file that has the text "1234" in it, you don't even need to put in the
<?php ?> at all... just have this for breadcrumbs.php
1234
| |
| leegold 2006-01-23, 9:55 pm |
|
"Ken Chau" <gizzar@gmail.com> wrote in message
news:1137996575.404042.276700@o13g2000cwo.googlegroups.com...
> that's just the oddest thing... if you're trying to require_once a PHP
> file that has the text "1234" in it, you don't even need to put in the
> <?php ?> at all... just have this for breadcrumbs.php
>
> 1234
>
Just a test to get it working...
|
|
|
|