tags:

views:

84

answers:

3

Hello,

For some reason it seems to be working fine, only when I used <?php ?> tag. Does not work with <? ?>

What's wrong here?

Thanks Jean

+1  A: 

There's a php.ini setting (short_open_tag: boolean, default: "1") to enable the use of <? ?>

RC
No, that enables <% and %>. For <? you'll need short_open_tag php.ini directive.
Daniel
my bad, for the confusion, correcting the answer
RC
+1 for fix. not quite sure why you thought `asp_tags` was correct though.
Mark
@Mark, just an error probably due to multi-tasking ;)Thanks.
RC
+6  A: 

Enable short_open_tag in php.ini or enable Php short open tags in php settings in wamp (In windows)...

OM The Eternity
+4  A: 

Nothing's wrong. And RC quoted the wrong option.. it's short_open_tag that you're interested in. This is why people advise against using short tags, because you run into problems like this when you try switching servers.


Before you guys go and horribly miscontrue my "nothing's wrong" statement, I mean that it's not a bug or defect... you're just not using the correct settings.

Mark
+1 for the nothing wrong ;)
RC
@mark I used to use the <? ?> but for some reason, it does not work now, which makes me ponder, the php.ini settings have not been changed
Jean
@Jean: Well, *something* must have changed. You can dynamically change the settings with ini_set http://ca.php.net/manual/en/function.ini-set.php as well, y'know.
Mark
Editing ini settings is not any problem. ini settings are intended for that.
Col. Shrapnel