View previous topic :: View next topic |
Author |
Message |
Zynv -
Joined: 28 Aug 2006 Posts: 3
|
Posted: Mon Aug 28, 2006 6:40 pm Post subject: Php tag <?= not recognized |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Mon Aug 28, 2006 7:19 pm Post subject: |
|
|
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 |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Mon Aug 28, 2006 7:25 pm Post subject: |
|
|
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 |
|
 |
Zynv -
Joined: 28 Aug 2006 Posts: 3
|
Posted: Mon Aug 28, 2006 7:27 pm Post subject: |
|
|
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 |
|
 |
Zynv -
Joined: 28 Aug 2006 Posts: 3
|
Posted: Mon Aug 28, 2006 7:29 pm Post subject: |
|
|
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 |
|
 |
|