Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Shall I enable short tags?

0 views
Skip to first unread message

varois83

unread,
Dec 28, 2004, 8:24:21 PM12/28/04
to
Hi

I am fairly new to PHP/mysql and was reading an online tutorial and
learned that my short tags weren't enabled.
At this time I have no need for them, my setup apache/mysql/php runs on
my PC just to test code.
Shall I enable short tags or not?
Windows XP pro
PHP 4

Thanks a lot

Patrick

Michael Fesser

unread,
Dec 28, 2004, 8:46:42 PM12/28/04
to
.oO(varois83)

>I am fairly new to PHP/mysql and was reading an online tutorial and
>learned that my short tags weren't enabled.

Good.

>At this time I have no need for them, [...]

And you don't really need them.

>Shall I enable short tags or not?

No.

Micha

PhilM

unread,
Dec 29, 2004, 5:48:20 PM12/29/04
to
>Shall I enable short tags or not?
>
> No.
>
> Micha

In a follow up to Michael, here is a scenario why.

You just finished writing a web app, wth 100's/1000's of code lines, heaps
of includes, sub apps etc, making use of short tags. You then upload to your
newly purchased webspace, and it doesn't work cos they have short tags
disabled.
You will have fun then, altering the many instances of short tag code.

If you don't use short tags, it will still work as expected on a server with
short tags enabled. Much more friendly.

I have downloaded a number of cms's that were apparently all the rave, only
to find they were written using short tags. My test server doesn't have them
enabled, so to preview them, I had to go through and alter. Not nice. Ended
up deleting, and looking at others.


Chung Leong

unread,
Dec 31, 2004, 3:30:39 PM12/31/04
to
"varois83" <varo...@netzero.net> wrote in message
news:1104283461.5...@f14g2000cwb.googlegroups.com...

I like short tags because you can do ASP style <?=$var?> echos. Most ISPs
leave it on since there's not much of a reason to turn it off.


R. Rajesh Jeba Anbiah

unread,
Jan 1, 2005, 3:05:52 AM1/1/05
to
varois83 wrote:
> I am fairly new to PHP/mysql and was reading an online tutorial and
> learned that my short tags weren't enabled.
> At this time I have no need for them, my setup apache/mysql/php runs
on
> my PC just to test code.
> Shall I enable short tags or not?

You're asking one of the "religious" questions--you won't be getting
fair answer here.

You can enable short tags. Short tags are cool and fast (in terms of
coding and execution). When short tags are enabled, you _may_ encounter
some problems when you're outputting XML codes via PHP; this however
can be solved by coding in "such a way".

Most of the servers should support short tags; but there may be few
that don't support.

If you use short tags and if the server doesn't support it, you can
easily do search and replace (ie, <?= to <?php echo). But, there may be
few or many dumb clients who may not be knowing how to handle this
situations.

Personally, though I'm (still) a good fan of short tags, now I'm
moved to long tags. My suggestion is to enable short tags, but to code
in long tags--so that you achieve wide range of compatibility. (If you
disable short tags but did try to output XML, there are chances such
PHP code may not be usable when running on servers with short tags
enabled).

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

varois83

unread,
Jan 1, 2005, 10:47:39 AM1/1/05
to

Hi

This is the original poster. I want to thank everybody who took the
time to answer. I won't enable them at this time.

Thanks again

Patrick

Kenneth Porter

unread,
Jan 17, 2005, 4:01:26 PM1/17/05
to
"R. Rajesh Jeba Anbiah" <ng4rrj...@rediffmail.com> wrote in
news:1104566752.0...@z14g2000cwz.googlegroups.com:

> If you use short tags and if the server doesn't support it, you can
> easily do search and replace (ie, <?= to <?php echo). But, there may be
> few or many dumb clients who may not be knowing how to handle this
> situations.

Servers (actually, server-side interpreters), not clients. The clients
never see the PHP.

R. Rajesh Jeba Anbiah

unread,
Jan 18, 2005, 12:38:40 PM1/18/05
to

I meant, clients==customers. My English is very poor; sorry.

0 new messages