473,545 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting of <? and <?php

Hi,

I'm now doing web programming using PHP. I need to use <?php instead of <?
for PHP scripts.

How do I configure PHP so that it can recognize <? as well??

Thanks in advance
Wing
Jul 17 '05 #1
20 4626
On 2004-01-14, wing <wi**@wing.co m> wrote:
Hi,

I'm now doing web programming using PHP. I need to use <?php instead of <?
for PHP scripts.

How do I configure PHP so that it can recognize <? as well??


short_open_tag = on

But be aware, there are some issues you should be aware of when using
it.

--
http://home.mysth.be/~timvw
Jul 17 '05 #2
"Tim Van Wassenhove" <eu**@pi.be> ¦b¶l¥ó
news:bu******** ****@ID-188825.news.uni-berlin.de ¤¤¼¶¼g...
On 2004-01-14, wing <wi**@wing.co m> wrote:
Hi,

I'm now doing web programming using PHP. I need to use <?php instead of <? for PHP scripts.

How do I configure PHP so that it can recognize <? as well??
short_open_tag = on

But be aware, there are some issues you should be aware of when using
it.

Thanks for your reply but can you please specify what needs to be aware of??

Wing


--
http://home.mysth.be/~timvw

Jul 17 '05 #3
"wing" <wi**@wing.co m> wrote in message news:<bu******* ***@news.ust.hk >...
Hi,

I'm now doing web programming using PHP. I need to use <?php instead of <?
for PHP scripts.

How do I configure PHP so that it can recognize <? as well??

Thanks in advance
Wing


Review the following section in *php.ini* file.

[SNIP]

; Allow the <? tag. Otherwise, only <?php and <script> tags are
recognized.
; NOTE: Using short tags should be avoided when developing
applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable
code,
; be sure not to use short tags.
short_open_tag = On

[/SNIP]

You can enable or disable *short_open_tag * (<?) by writing On or Off
respectively in your php.ini file.

--
Cheers,
Rahul
Jul 17 '05 #4
wing wrote:
"Tim Van Wassenhove" <eu**@pi.be> ¦b¶l¥ó
news:bu******** ****@ID-188825.news.uni-berlin.de ¤¤¼¶¼g...
On 2004-01-14, wing <wi**@wing.co m> wrote:
Hi,

I'm now doing web programming using PHP. I need to use <?php
instead of <? for PHP scripts.

How do I configure PHP so that it can recognize <? as well??


short_open_tag = on

But be aware, there are some issues you should be aware of when using
it.

Thanks for your reply but can you please specify what needs to be
aware of??

Wing


If you're using XML, it's a pain in the ass because PHP will think that your
XML is PHP. Seriously, leave short tags off, it's bad style.
Jul 17 '05 #5
Agelmar wrote:
If you're using XML, it's a pain in the ass because PHP will think that your
XML is PHP. Seriously, leave short tags off, it's bad style.


That is the standard argument (and the only one) I always hear against
short tags, and the argument I hear against using them in a script is
that it doesn't run with short tags off otherwise.

However, since short_open_tags = on is the default setting, turning them
off is (should be) a concious effort, so noone does it without a reason.
All hosting companies I know leave the default setting, so I see
nothing wrong with using the short tags. (For one thing "<?=" looks so
much neater in a template than "<?php echo".)

If someone absolutely has to have the tags off, they can use a per-dir
setting or use one simple sed command to change a whole application to
long tags, so I don't see why I should burden myself (and the template
designers) with long tags just because the style police says so.

LLAP,
Jochen

Jul 17 '05 #6
Jochen Buennagel wrote:
Agelmar wrote:
If you're using XML, it's a pain in the ass because PHP will think
that your XML is PHP. Seriously, leave short tags off, it's bad
style.


That is the standard argument (and the only one) I always hear against
short tags, and the argument I hear against using them in a script is
that it doesn't run with short tags off otherwise.

However, since short_open_tags = on is the default setting, turning
them
off is (should be) a concious effort, so noone does it without a
reason. All hosting companies I know leave the default setting, so
I see
nothing wrong with using the short tags. (For one thing "<?=" looks so
much neater in a template than "<?php echo".)

If someone absolutely has to have the tags off, they can use a per-dir
setting or use one simple sed command to change a whole application to
long tags, so I don't see why I should burden myself (and the template
designers) with long tags just because the style police says so.

LLAP,
Jochen


Just because poor style works doesn't mean you should use it. I can forgoe
all array subscripting in C and just use arrayName + whatever*sizeof (int)
instead of arrayName[whatever] - does that mean I should? <?php will work on
all platforms. <? will not. Thus, if you care about compatibility, it's a no
brainer.
Jul 17 '05 #7
Both <?php and <? are poor style. We should all use <script
language="php"> </script> instead.

Uzytkownik "Agelmar" <if**********@c omcast.net> napisal w wiadomosci
news:bu******** ****@ID-30799.news.uni-berlin.de...
Jochen Buennagel wrote:
Agelmar wrote:
If you're using XML, it's a pain in the ass because PHP will think
that your XML is PHP. Seriously, leave short tags off, it's bad
style.
That is the standard argument (and the only one) I always hear against
short tags, and the argument I hear against using them in a script is
that it doesn't run with short tags off otherwise.

However, since short_open_tags = on is the default setting, turning
them
off is (should be) a concious effort, so noone does it without a
reason. All hosting companies I know leave the default setting, so
I see
nothing wrong with using the short tags. (For one thing "<?=" looks so
much neater in a template than "<?php echo".)

If someone absolutely has to have the tags off, they can use a per-dir
setting or use one simple sed command to change a whole application to
long tags, so I don't see why I should burden myself (and the template
designers) with long tags just because the style police says so.

LLAP,
Jochen


Just because poor style works doesn't mean you should use it. I can forgoe
all array subscripting in C and just use arrayName + whatever*sizeof (int)
instead of arrayName[whatever] - does that mean I should? <?php will work

on all platforms. <? will not. Thus, if you care about compatibility, it's a no brainer.

Jul 17 '05 #8
Chung Leong wrote:
Both <?php and <? are poor style. We should all use <script
language="php"> </script> instead.


Hmm... actually, that's not a bad suggestion.
Jul 17 '05 #9
Agelmar wrote:
Thus, if you care about compatibility, it's a no brainer.

I've never had any complaints yet (except from the style police).

Jul 17 '05 #10

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

Similar topics

1
6804
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
2
10546
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
4
62090
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I supposed to write this function? String.replace(/</g,'&lt;');
11
13662
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> ...
11
3107
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some useful utils that more pages on that server can use. As an example, I have created a Page Counter class that opens an Access .mdb file, counts the...
9
5530
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
8
2345
by: Efi Merdler | last post by:
Hi, In my code I'm doing some xml transformation, at the end I receive a fully transformed html file. I'm setting the Value property of an hidden field control to have the content of this html file. In the debugger I can see that the control contains the value correctly, however when the page is displayed in a browser all < symbols are...
1
5454
by: David Henderson | last post by:
I know 'disable-output-escaping' has been discussed in the past, but I can't put my finger on any of the threads to see if my current problem is addressed. Sorry for re-asking the question if it has already been answered... I have an XML doc that I am transforming via XSLT and JavaScript in the browser. This allows me to return...
6
1955
by: Steve | last post by:
I have a div with two - three paragrahs in it. Each paragraph has its own inline style tag with its own font size setting. When I set the last paragraph's font size the font sizes for ALL of the paragraphs change. Why? How can I stop it? I.E>
0
7486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7676
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7776
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6001
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...
0
4965
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...
0
3473
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...
1
1905
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
0
729
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...

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.