473,915 Members | 3,916 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 4682
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
6843
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
2
10581
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
62134
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
13750
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 --> <H1>Hello World!</H1> <P>More stuff here...</P>
11
3152
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 current entries for that page, and adds a new entry with some information regarding the current...
9
5564
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
2362
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 replaced by &lt; .
1
5494
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 unsorted data to the browser and allow the user to sort it with a mouseclick and not hit the server just...
6
1978
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
11359
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10928
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10543
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9734
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...
0
7259
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
5944
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
6149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4779
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
3
3370
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.