Php tag <?= not recognized

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Zynv
-


Joined: 28 Aug 2006
Posts: 3

PostPosted: Mon Aug 28, 2006 6:40 pm    Post subject: Php tag <?= not recognized Reply with quote

Greetings.

I appologize if as question like this already been asked, I've checked the first 7 pages of posts... and if there is a topic for my question I've missed it...

I've just installed clean Abyss WebServer on WindowsXP platform (dont' throw stones at me... I was forced).
I've installed latest 5.1.6 and MySQL. All have been configured... or so I shought.

Strangely enough all code between <?php print 'This will be printed'; ?> tags executes just fine,
but if I use immediate-print tags (<?='This will be printed'?>) it is treated as simple text and not executed as PHP code.

I have not seen this problem before and was nto able to find any referances on it.

Any help or hints are greatly appreciated.
Thank you.
~Zynv
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Mon Aug 28, 2006 7:19 pm    Post subject: Reply with quote

You have not told php what to do so its not going to execute it. You must use php tags, <?php and ?> and use a command telling it what to do with text you put in. echo() or print() will put out the text. Just putting text inside <? ?> tags wont do anything since thats not php.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Mon Aug 28, 2006 7:25 pm    Post subject: Reply with quote

You must enable short_tags in the PHP configuration. However, I do not recommend you to use short tags since it screws up XML files (because they start with <?).
Back to top View user's profile Send private message
Zynv
-


Joined: 28 Aug 2006
Posts: 3

PostPosted: Mon Aug 28, 2006 7:27 pm    Post subject: Reply with quote

AbyssUnderground wrote:
You have not told php what to do so its not going to execute it. You must use php tags, <?php and ?> and use a command telling it what to do with text you put in. echo() or print() will put out the text. Just putting text inside <? ?> tags wont do anything since thats not php.


Err... I believe you misunderstood me... the <?= tag does immediate print of what you specify in it.
Example:

Code:

<div>Your username is: <?=$UserName?></div>


Instead of:
Code:

print '<div>Your username is: '.$UserName."</div>\n";


It works on my other 3 servers... just not on this new one for some strange reason.
Back to top View user's profile Send private message
Zynv
-


Joined: 28 Aug 2006
Posts: 3

PostPosted: Mon Aug 28, 2006 7:29 pm    Post subject: Reply with quote

cmxflash wrote:
You must enable short_tags in the PHP configuration. However, I do not recommend you to use short tags since it screws up XML files (because they start with <?).


Marvelous. That works. Thanks a bunch.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group