php syntax problem - need help

This is a discussion on php syntax problem - need help within the alt.comp.lang.php forums, part of the PHP Programming Forums category; given I have in main.php : <?php require_once 'breadcrumbs.php'; ?> and in breadcrumbs.php I have: <? class ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-22-2006
leegold
 
Posts: n/a
Default php syntax problem - need help

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


Reply With Quote
  #2 (permalink)  
Old 01-22-2006
goldtech@worldpost.com
 
Posts: n/a
Default Re: php syntax problem - need help

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...

Reply With Quote
  #3 (permalink)  
Old 01-22-2006
rlee0001
 
Posts: n/a
Default Re: php syntax problem - need help

You don't need the braces either. Just the echo statement itself.

-Robert

Reply With Quote
  #4 (permalink)  
Old 01-23-2006
Ken Chau
 
Posts: n/a
Default Re: php syntax problem - need help

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

Reply With Quote
  #5 (permalink)  
Old 01-24-2006
leegold
 
Posts: n/a
Default Re: php syntax problem - need help


"Ken Chau" <gizzar@gmail.com> wrote in message
news:1137996575.404042.276700@o13g2000cwo.googlegr oups.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...


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:56 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0