Jump to content


Photo

<? not working


  • Please log in to reply
3 replies to this topic

#1 Monroe

Monroe
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 10 April 2006 - 10:13 PM

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?

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 10 April 2006 - 10:45 PM

This is a setting in the php.ini file that allows you to choose which flags identify php.

It is considered good practice to use <?php and ignore using anything else so if you can just use <?php.
follow me on twitter @PHPsycho

#3 Monroe

Monroe
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 11 April 2006 - 03:20 AM

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

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 April 2006 - 07:47 AM

You will need to turn on the short_open_tag 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 ?>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users