FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Variable expansion <?=$foo?> not working anymore
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Variable expansion <?=$foo?> not working anymore [message #170667 is a reply to message #170654] Sun, 14 November 2010 16:50 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: where else can this list be found?
Next Topic: newbie question: Is config.php necessary?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 23:17:29 GMT 2024

Total time taken to generate the page: 0.03963 seconds