473,396 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Shall I enable short tags?

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

Jul 17 '05 #1
7 7089
.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
Jul 17 '05 #2
>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.
Jul 17 '05 #3
"varois83" <va******@netzero.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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


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.
Jul 17 '05 #4
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/

Jul 17 '05 #5

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

Jul 17 '05 #6
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.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.
Jul 17 '05 #7
Kenneth Porter wrote:
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.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.


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

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

Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jason G. | last post by:
I have heard that you cannot use short tags and XML because of the opening line of an xml document... <?xml version="1.0"?> Consider this: <<?= '?'; ?>xml version="1.0"<?= '?'; ?>> ...
1
by: Hans Gruber | last post by:
Hi all, Here`s a problem I have been working on for a while, but can`t seem to solve satisfactory. I have a database with blog entries. Because each of those entries has a variable length...
2
by: nospam | last post by:
I'm trying to do a transform on some xml using the XslTransform class. The input xml contains an empty element in short format like this... <element attrib="abc"/> But during the transform...
7
by: gorkos | last post by:
Hi, I am two days trying to solve a problem with some pages, which i get through HTTPWebRequest. Error is that some pages need Script to be enabled. But how to do this in HTTPWebRequest class?
7
by: mmarlow | last post by:
Hi all, I wish I knew if this was even a PHP problem or not! It's probably Internet Explorer but here goes anyway... Random pages at random times don't appear correctly in IE6, the HTML is...
8
by: comp.lang.php | last post by:
I installed WAMP5 on my WinXP box which works just fine on its own, and I found a practical way of handling my short-tag PHP script via .htaccess: php_flag short_open_tag on To ensure my...
2
by: varois83 | last post by:
Hi I am just starting with PHP. I am reading a PHP 5 book and they say to not use short tags and to actually disable them so I see an error message if I don't form my tags correctly....
16
by: Peter Oliphant | last post by:
Note that although this involves SAPI, it is more a question about Timers and event handlers. I wrote a Speech Recognize handler (SAPI), and put some code in it to enable a Timer. It would not...
4
by: Sony89 | last post by:
Hi guys. How can you enable short tags in your browser?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.