2

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

What's wrong here?

1

3 Answers 3

7

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

Sign up to request clarification or add additional context in comments.

Comments

5

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.

3 Comments

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: Well, something must have changed. You can dynamically change the settings with ini_set ca.php.net/manual/en/function.ini-set.php as well, y'know.
Editing ini settings is not any problem. ini settings are intended for that.
2

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

3 Comments

No, that enables <% and %>. For <? you'll need short_open_tag php.ini directive.
+1 for fix. not quite sure why you thought asp_tags was correct though.
@Mark, just an error probably due to multi-tasking ;) Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.