Variable expansion <?=$foo?> not working anymore [message #170654] |
Sat, 13 November 2010 22:29 |
Johannes Bauer
Messages: 2 Registered: November 2010
Karma: 0
|
Junior Member |
|
|
Hello group,
I use variable expansion like
<?=$HTTP_POST_VARS["foo"]?>
in some of my scripts. After updating to 5.3.3 (and possibly some
php.ini configuration updates), this expansion stopped working (it is
just put in literally into the document).
Since I do not know what that type of expansion is called and searches
for "php <?=$" were not really successful, I'd like to know: Is this
deprecated? If not, how do I reenable it?
Kind regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in dsa <hidbv3$om2$1(at)speranza(dot)aioe(dot)org>
|
|
|
Re: Variable expansion <?=$foo?> not working anymore [message #170655 is a reply to message #170654] |
Sat, 13 November 2010 22:58 |
Gregor Kofler
Messages: 69 Registered: September 2010
Karma: 0
|
Member |
|
|
Am 2010-11-13 23:29, Johannes Bauer meinte:
> Hello group,
>
> I use variable expansion like
>
> <?=$HTTP_POST_VARS["foo"]?>
>
> in some of my scripts. After updating to 5.3.3 (and possibly some
> php.ini configuration updates), this expansion stopped working (it is
> just put in literally into the document).
>
> Since I do not know what that type of expansion is called and searches
> for "php <?=$" were not really successful, I'd like to know: Is this
> deprecated? If not, how do I reenable it?
The setting short_open_tag is disabled [1].
Either enable it in your php.ini or - much better - switch to proper
notation (in your case replace the <?= ... ?> with <?php echo ... ?>).
Gregor
[1]
http://php.net/manual/en/ini.core.php
--
http://vxjs.gregorkofler.com
|
|
|
Re: Variable expansion <?=$foo?> not working anymore [message #170656 is a reply to message #170654] |
Sun, 14 November 2010 01:11 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 13/11/10 22:29, Johannes Bauer wrote:
> Hello group,
>
> I use variable expansion like
>
> <?=$HTTP_POST_VARS["foo"]?>
>
> in some of my scripts. After updating to 5.3.3 (and possibly some
> php.ini configuration updates), this expansion stopped working (it is
> just put in literally into the document).
>
> Since I do not know what that type of expansion is called and searches
> for "php <?=$" were not really successful, I'd like to know: Is this
> deprecated? If not, how do I reenable it?
It wouldn't be something as simple as:
<?php echo $ARRAY_NAME["key"]; ?>
would it?
Rgds
Denis McMahon
|
|
|
Re: Variable expansion <?=$foo?> not working anymore [message #170658 is a reply to message #170654] |
Sun, 14 November 2010 04:03 |
Magno
Messages: 49 Registered: October 2010
Karma: 0
|
Member |
|
|
On 11/13/2010 07:29 PM, Johannes Bauer wrote:
> Hello group,
>
> I use variable expansion like
>
> <?=$HTTP_POST_VARS["foo"]?>
>
> in some of my scripts. After updating to 5.3.3 (and possibly some
> php.ini configuration updates), this expansion stopped working (it is
> just put in literally into the document).
>
> Since I do not know what that type of expansion is called and searches
> for "php<?=$" were not really successful, I'd like to know: Is this
> deprecated? If not, how do I reenable it?
>
> Kind regards,
> Johannes
>
I think I heard (or read) they are deprecated, perhaps. Or I think that
not recommended.
....I guess.
|
|
|
Re: Variable expansion <?=$foo?> not working anymore [message #170661 is a reply to message #170655] |
Sun, 14 November 2010 09:32 |
Johannes Bauer
Messages: 2 Registered: November 2010
Karma: 0
|
Junior Member |
|
|
Am 13.11.2010 23:58, schrieb Gregor Kofler:
>> Since I do not know what that type of expansion is called and searches
>> for "php <?=$" were not really successful, I'd like to know: Is this
>> deprecated? If not, how do I reenable it?
>
> The setting short_open_tag is disabled [1].
It is indeed, thank you very much. Previously it was always enabled -
now it seems that with Gentoo it's disabled by default.
> Either enable it in your php.ini or - much better - switch to proper
> notation (in your case replace the <?= ... ?> with <?php echo ... ?>).
Hm - is the <?= variant deprecated? What's the problem with it?
Kind regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in dsa <hidbv3$om2$1(at)speranza(dot)aioe(dot)org>
|
|
|
|
Re: Variable expansion <?=$foo?> not working anymore [message #170664 is a reply to message #170654] |
Sun, 14 November 2010 16:10 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
.oO(Johannes Bauer)
> Hello group,
>
> I use variable expansion like
>
> <?=$HTTP_POST_VARS["foo"]?>
>
> in some of my scripts. After updating to 5.3.3 (and possibly some
> php.ini configuration updates), this expansion stopped working (it is
> just put in literally into the document).
>
> Since I do not know what that type of expansion is called and searches
> for "php <?=$" were not really successful, I'd like to know: Is this
> deprecated? If not, how do I reenable it?
It's deprecated for various reasons. And the old long arrays are
deprecated too, so the above code should look like this instead:
<?php echo $_POST['foo'];?>
Micha
|
|
|
Re: Variable expansion <?=$foo?> not working anymore [message #170667 is a reply to message #170654] |
Sun, 14 November 2010 16:50 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma: 0
|
Senior Member |
|
|
Johannes Bauer wrote:
> I use variable expansion like
>
> <?=$HTTP_POST_VARS["foo"]?>
>
> in some of my scripts. After updating to 5.3.3 (and possibly some
> php.ini configuration updates), this expansion stopped working (it is
> just put in literally into the document).
>
> Since I do not know what that type of expansion is called and searches
> for "php <?=$" were not really successful, I'd like to know: Is this
> deprecated? If not, how do I reenable it?
You better don't, and you should fix your libraries instead. But if you
absolutely need to use it, set short_open_tag to 1 in php.ini. Beware
incompatibilities, in particular with different server configurations and
XML declarations.
Both short tags and the $HTTP_* variables are deprecated since PHP 5; use
<?php echo $_POST['foo']; ?>
instead (and you probably want to escape it with, say, htmlspecialchars(),
too).
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
|
|
|