Jump to content

Recommended Posts

Hi,

I just upgraded from php 5.1 to php 5.2. I have my php running under IIS.
All of my php seems to work fine besides one thing. When i create a from that looks something like the following.
[code]
<?php
$myPhpString="this is a string";
?>
<form>
    <input value="<?=$myPhpString?>" />
</form>
[/code]

instead of putting the value "[color=red]this is a string[/color]" as text in my input tag it puts <?=$myPhpString?>[/color]" /> in the textfield in my browser with tags and all.

Anyone know what the the trouble could be?

thnx
Link to comment
https://forums.phpfreaks.com/topic/26160-upgrade-trouble-php-52-iis/
Share on other sites

When you upgraded you didn't turn the [b]short_open_tag[/b] directive on in the php.ini

However I do not recommend you to rely on short tags when coding your scripts, for compatibilities sake. You should use the full tag: <?php or use <?php echo instead of <?=
[quote author=wildteen88 link=topic=113838.msg462914#msg462914 date=1162663034]
When you upgraded you didn't turn the [b]short_open_tag[/b] directive on in the php.ini

However I do not recommend you to rely on short tags when coding your scripts, for compatibilities sake. You should use the full tag: <?php or use <?php echo instead of <?=
[/quote]

What kind of compatibilities could be the problem? I use the short tags to keep my php code to a minimum in my form pages. most of my functions are build in classes to make my code more readable and maintainable
By compatibility I meant. If you coded your script with the short_open_tag directive enabled and you used the following tags:
<? or <?=

Then your scripts will fail to work or fail to function correctly when you run your scripts that had the short_open_tag directive disabled. Which is what your experiencing now when you upgraded form PHP5.1 top PHP5.2

Not all PHP set ups will have the short_open_tag directive enabled.

Thats why I said in order to make your scripts compatible you should use the full tags <?php instead of <? and <?php echo instead of <?=
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.