I've just loaded apache2 and php5 onto my windows test server and all lines in html using the shortcut ' <?=$name?> ' now display nothing.
Is this a feature no longer supported in php5, or is it a setting in php.ini?
Cheers all,
Paul.php.ini short_open_tagFirst where does $name var assigned? There is a option in PHP.ini auto import request, post and cookie vars. If you are using this feature, you need to make sure this is enabled in php.ini, other wise try import_request_vars("g");Thanks Drakla - that sorted it <? has been deprecated for a few years now - basically since XML came around.I've just loaded apache2 and php5 onto my windows test server and all lines in html using the shortcut ' <?=$name?> ' now display nothing.
Is this a feature no longer supported in php5, or is it a setting in php.ini?
Cheers all,
Paul.
Do yourself a favour and do it the proper way:
<?php echo($name) ?>
PHP is embedded in HTML using processing instructions. A processing instruction is identified using a name i.e: xml,php. <?= is not a valid processing instruction. If you are using XML; it would make the XML document invalid. If they introduced something like this it would be a lot better:
<?php =$name ?>
Unfortunatly it hasn't been deprecated in PHP yet, not even in the PHP 6 development snapshots
In any case short tags are not turned on by default and to ensure your scripts do not break on host which have it disabled it should be avoided.Thanks visualAd.
I'm rewriting this stuff right now. It's not that big a thing really .. find & replace tools rule Unfortunatly it hasn't been deprecated in PHP yet, not even in the PHP 6 development snapshots Hah, you're right; the recommendation is to use <?php but I remember now that agreement collapsed when it came to deciding whether or not to officially deprecate it.
Is this a feature no longer supported in php5, or is it a setting in php.ini?
Cheers all,
Paul.php.ini short_open_tagFirst where does $name var assigned? There is a option in PHP.ini auto import request, post and cookie vars. If you are using this feature, you need to make sure this is enabled in php.ini, other wise try import_request_vars("g");Thanks Drakla - that sorted it <? has been deprecated for a few years now - basically since XML came around.I've just loaded apache2 and php5 onto my windows test server and all lines in html using the shortcut ' <?=$name?> ' now display nothing.
Is this a feature no longer supported in php5, or is it a setting in php.ini?
Cheers all,
Paul.
Do yourself a favour and do it the proper way:
<?php echo($name) ?>
PHP is embedded in HTML using processing instructions. A processing instruction is identified using a name i.e: xml,php. <?= is not a valid processing instruction. If you are using XML; it would make the XML document invalid. If they introduced something like this it would be a lot better:
<?php =$name ?>
Unfortunatly it hasn't been deprecated in PHP yet, not even in the PHP 6 development snapshots
In any case short tags are not turned on by default and to ensure your scripts do not break on host which have it disabled it should be avoided.Thanks visualAd.
I'm rewriting this stuff right now. It's not that big a thing really .. find & replace tools rule Unfortunatly it hasn't been deprecated in PHP yet, not even in the PHP 6 development snapshots Hah, you're right; the recommendation is to use <?php but I remember now that agreement collapsed when it came to deciding whether or not to officially deprecate it.