Jump to content

[SOLVED] <? vs <?php


Nathanl

Recommended Posts

This may be a pretty basic newb question, but i cant find the answer elsewhere.

 

 

I'm not a php guy, its on the list of languages to learn, but ive been occupying myself with Perl, and C lately. 

 

Anyway, i have a server, running windows 2000, that a customer is running a PHP calendar application on.

 

I had some trouble with php, but i got it worked out by running PHP in cgi mode vs isapi mode.

 

Now php is working, but it only parses code which uses "<?php" as the opening tag.  His application of course uses "<?" in all of its code.

 

Ive done some digging online, and everyone says that they two opening tags are interchangable.  If thats the case, why doesnt this server parse code opened with the "<?" tag? Is there some sort of option in php.ini which allows this?

 

Thanks!

 

Link to comment
Share on other sites

From the manual:

While the tags seen in examples one and two are both always available, example one is the most commonly used, and recommended, of the two.

 

Short tags (example three) are only available when they are enabled via the short_open_tag php.ini configuration file directive, or if php was configured with the --enable-short-tags option.

 

    Note: If you are using PHP 3 you may also enable short tags via the short_tags() function. This is only available in PHP 3!

 

This was found on the Basic Syntax page of the manual. Basically, if you want to use the "<?" short tags, you've got to see if short_open_tag is turned on in your php.ini file.

 

Hope this helps.

Link to comment
Share on other sites

From the manual:

While the tags seen in examples one and two are both always available, example one is the most commonly used, and recommended, of the two.

 

Short tags (example three) are only available when they are enabled via the short_open_tag php.ini configuration file directive, or if php was configured with the --enable-short-tags option.

 

    Note: If you are using PHP 3 you may also enable short tags via the short_tags() function. This is only available in PHP 3!

 

This was found on the Basic Syntax page of the manual. Basically, if you want to use the "<?" short tags, you've got to see if short_open_tag is turned on in your php.ini file.

 

Hope this helps.

 

Thank you!!

I didnt even know that the manual existed until now.  Like i said, i'm pretty new to php.

 

That option fixed it, thank you!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.