Jump to content

Server Move, Strange problem...


New Coder

Recommended Posts

Hello All,

 

My site has been moved from a production server, to a desktop running vista and iis7 for testing and upgrading.

 

All works currently except one item:

 

<body style="background:url(images/<?php rand(1,5).".jpg"; ?>) no-repeat fixed bottom right;">

 

However if I add echo like:

<body style="background:url(images/<?php echo rand(1,5).".jpg"; ?>) no-repeat fixed bottom right;">

 

it works again  :confused:

Why is that? the first example works fine on the production server... Am i missing a setting in IIS? I have checked the MIME types.

 

Many Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/187244-server-move-strange-problem/
Share on other sites

It sounds like your production server has short_open_tag() enabled in the PHP.INI and your IIS doesn't.

 

"[echo()] has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. This short syntax only works with the short_open_tag configuration setting enabled. " (http://php.net/manual/en/function.echo.php)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.