You are here: Re: It appears that <?php ... ?> is not portable. If this is true, why do so many scripts use it? « PHP Programming Language « IT news, forums, messages
Re: It appears that <?php ... ?> is not portable. If this is true, why do so many scripts use it?

Posted by farrishj@gmail.com on 05/28/07 15:34

On May 28, 10:14 am, Michael <MichaelDMcDonn...@yahoo.com> wrote:
> I'm new to PHP.
>
> Evidently my ISP's server does not recognize <?php ... ?>, but it does
> recognize <script language="php"> ... </script>, which would imply
> that <?php ... ?> is not portable.
>
> If in fact <?php ... ?> is not portable, why are so many PHP scripts
> using it?

Hmm, never heard of that. Do you have a documentation page that the
ISP has provided explaining this (and maybe why...)?

In general, portability of scripts means that most other servers out
there have at least a basic parser hook into your code (using <?php ?>
tags, or <?asp ?> for ASP, etc...). This is MORE portable than using
short tags (such as <? ?>).

Imagine you are a parser (maybe with an Italian accent, just for fun).
What do you do if:

<? ?>

??? Could be ASP, could be PHP, could be xml or any other number of
denoted, parseable scripting entities on a page. <?php says "This is
PHP, as long as you understand it (with a PHP parser). Ignore
otherwise."

If an ISP manually renders <?php ?> useless, that's an ISP position. I
can't imagine why they would have done this, as anybody who would want
to use their service for their PHP support would then have to change
all their code pages to reflect the new code tags, which are not
standard and in no way portable.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация