Jump to content

Archived

This topic is now archived and is closed to further replies.

Monroe

<? not working

Recommended Posts

PHP version 5.1.2 (pecl-5.1.2 also)
mysql version 5.0.18
Server OS: Server 2003
IIS version 6.0

When I try to run php files that start with <? they don't work but if I use <?php they work. If I try a file that starts with <? as soon as it hits a > in the code it begins to print on the screen untill it hits another <...> then prints again. It is like it is acting as html tags or something. Any ideas?

Share this post


Link to post
Share on other sites
This is a setting in the php.ini file that allows you to choose which flags identify php.

It is considered [b]good[/b] practice to use <?php and ignore using anything else so if you can just use <?php.

Share this post


Link to post
Share on other sites
I know but I am trying to use existing scripts on my webiste that are written with <? thanks for the reponse.

Share this post


Link to post
Share on other sites
You will need to turn on the [b]short_open_tag[/b] directive in the php.ini file.

Once you have switched it on you will need to save the php.ini file and then restart IIS. You should now be able to use short open tags <? ?> aswell as <?php ?>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.