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 20 4606
On 2004-01-14, wing <wi**@wing.com> 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
"Tim Van Wassenhove" <eu**@pi.be> ¦b¶l¥ó
news:bu************@ID-188825.news.uni-berlin.de ¤¤¼¶¼g... On 2004-01-14, wing <wi**@wing.com> 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
"wing" <wi**@wing.com> 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
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.com> 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.
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
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.
Both <?php and <? are poor style. We should all use <script
language="php"></script> instead.
Uzytkownik "Agelmar" <if**********@comcast.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.
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.
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).
Chung Leong wrote upsidedown: We should all use <script language="php"></script> instead.
So would I be correct in thinking that you reckon we should take
incompetent editors into consideration? Why? Or did you just forget
the smiley? What really makes you disagree with The Manual?
--
Jock
XML use <? also
Savut
"wing" <wi**@wing.com> 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
See http://www.php.net/manual/en/function.is-sarcasm.php for more info.
Uzytkownik "John Dunlop" <jo*********@johndunlop.info> napisal w wiadomosci
news:MP************************@news.freeserve.net ... Chung Leong wrote upsidedown:
We should all use <script language="php"></script> instead.
So would I be correct in thinking that you reckon we should take incompetent editors into consideration? Why? Or did you just forget the smiley? What really makes you disagree with The Manual?
-- Jock
Chung Leong wrote upsidedown: Uzytkownik "John Dunlop" <jo*********@johndunlop.info> napisal w wiadomosci news:MP************************@news.freeserve.net ... Chung Leong wrote upsidedown:
We should all use <script language="php"></script> instead.
So would I be correct in thinking that you reckon we should take incompetent editors into consideration? Why? Or did you just forget the smiley? What really makes you disagree with The Manual?
See http://www.php.net/manual/en/function.is-sarcasm.php for more info.
Right, OK, OK. A smiley would've helped me there! :-] http://www.google.com/googlegroups/p...yle.html#humor http://sic.epfl.ch/SA/News/Smiley.html
But in all earnest, your sarcastic recommendation is surely
reasonable, since AFAIK, the "<script...>" PHP tag is the only one
that is supported everywhere. I have no idea why a not-very-well-
documented, deprecated HTML notation was chosen as PHP tags though --
that'd be another discussion altogether.
The Manual says that even "<?php" won't work on editors that don't
grok processing instructions, and, <sarcasm>lo and behold</sarcasm>,
FrontPage is given as an example. That doesn't stop them from
recommending using "<?php" though. I'm with them on that.
EOD?
--
Jock
John Dunlop wrote: The Manual says that even "<?php" won't work on editors that don't grok processing instructions, and, <sarcasm>lo and behold</sarcasm>, FrontPage is given as an example. That doesn't stop them from recommending using "<?php" though. I'm with them on that.
The Manual also says about short_open_tags: "If you want to use PHP in
combination with XML, you can disable this option."
There is no other reason given for turning them off. The fact that
short_open_tags=on is the default tells me that it is the preferred
setting for most applications, so I use it until someone (except the
style-police) complains.
Jochen
Well, the only situation I can think of is when you use PHP to parse .xml
files.
Otherwise, for maximum compatibility you would do
<?php
echo '<?xml version="1.0" encoding="utf-8"?>';
// PHP stuff
?>
instead of
<?xml version="1.0" encoding="utf-8"?>
<?php
// PHP stuff
?>
anyway, which, of course, removes the reason to turn short tags off.
Besides short tags I also use the alternative control structure syntax (<?
if($login): ?><p> ... </p><? endif; ?>), so I think the style police will
probably shoot me first ;-)
Uzytkownik "Jochen Buennagel" <za*********@buennagel.com> napisal w
wiadomosci news:bu*************@news.t-online.com... John Dunlop wrote:
The Manual says that even "<?php" won't work on editors that don't grok processing instructions, and, <sarcasm>lo and behold</sarcasm>, FrontPage is given as an example. That doesn't stop them from recommending using "<?php" though. I'm with them on that.
The Manual also says about short_open_tags: "If you want to use PHP in combination with XML, you can disable this option."
There is no other reason given for turning them off. The fact that short_open_tags=on is the default tells me that it is the preferred setting for most applications, so I use it until someone (except the style-police) complains.
Jochen
Chung Leong wrote: Besides short tags I also use the alternative control structure syntax (<? if($login): ?><p> ... </p><? endif; ?>), so I think the style police will probably shoot me first ;-)
I do that too in templates, along with copious amounts of <?=$variable?>
Jochen
Regarding this well-known quote, often attributed to Chung Leong's famous
"Fri, 16 Jan 2004 12:46:53 -0500" speech: Well, the only situation I can think of is when you use PHP to parse .xml files.
Otherwise, for maximum compatibility you would do
<?php
echo '<?xml version="1.0" encoding="utf-8"?>'; // PHP stuff
?>
instead of
<?xml version="1.0" encoding="utf-8"?> <?php // PHP stuff ?>
anyway, which, of course, removes the reason to turn short tags off.
Besides short tags I also use the alternative control structure syntax (<? if($login): ?><p> ... </p><? endif; ?>), so I think the style police will probably shoot me first ;-)
Uzytkownik "Jochen Buennagel" <za*********@buennagel.com> napisal w wiadomosci news:bu*************@news.t-online.com... John Dunlop wrote:
The Manual says that even "<?php" won't work on editors that don't grok processing instructions, and, <sarcasm>lo and behold</sarcasm>, FrontPage is given as an example. That doesn't stop them from recommending using "<?php" though. I'm with them on that.
The Manual also says about short_open_tags: "If you want to use PHP in combination with XML, you can disable this option."
There is no other reason given for turning them off. The fact that short_open_tags=on is the default tells me that it is the preferred setting for most applications, so I use it until someone (except the style-police) complains.
Jochen
Of course, if you're running straight, hardcoded XML, then the XML file
vomits whenever you feed it into anything that can't take PHP.
--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Christian Schmidbauer |
last post by:
Hello!
I prepare my XML document like this way:
-------------------------------------------------------
PrintWriter writer;
Document domDocument;
Element domElement;
// Root tag
|
by: Donald Firesmith |
last post by:
I am having trouble having Google Adsense code stored in XSL converted
properly into HTML. The <> unfortunately become < and > and then
no longer work.
XSL code is:
<script...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
| |