473,789 Members | 2,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7109
.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******@netze ro.net> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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**********@r ediffmail.com> wrote in
news:11******** **************@ z14g2000cwz.goo glegroups.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**********@r ediffmail.com> wrote in
news:11******** **************@ z14g2000cwz.goo glegroups.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==custom ers. 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
9939
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"<?= '?'; ?>> Problem Solved.
1
2405
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 which can be quite long, I want to build an overview page. Of each entry there will be a preview version, say 700 characters max. My problem has to do with HTML tags. If for example an entry contains a
2
1541
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 it's being converted to the longer form like this... <element attrib="abc"></element>
7
7630
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
1501
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 actually cut short at seemingly random points (it's very random, you know). It could be at any character on any line. This is usually displayed simply as a background with no content, but viewing the source actually shows quite a lot, although sometimes...
8
5673
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 literally hundreds of PHP scripts will all function within the WAMP5 architecture. However, there is a case of a series of installer scripts written in
2
4208
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. "short_open_tag" is currently set to "on", shall I set it to "off"? I am not planning on using short tags. Thanks a lot
16
3258
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 do it. If I bring this same code outside this event handler, it works just fine. Is this normal?
4
3674
by: Sony89 | last post by:
Hi guys. How can you enable short tags in your browser?
1
10136
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9016
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4089
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.