Reply to Re: Please help a newbie - PHP is running, but code is not executed

Your name:

Reply:


Posted by Paul Lautman on 10/02/76 12:00

Alan Silver wrote:
> Hello,
>
> I hope someone will be able to help me on this. I am not very
> experienced with PHP, doing ASP.NET normally. I have a requirement to
> use a third-party set of PHP pages on a site, and it's not running
> properly. I don't think the problem is with the pages though, I think
> PHP might not be running correctly.
>
> The server is Windows 2003 Server with IIS and all the latest patches,
> service packs, etc. I have PHP 5.2.3 running, and if I create a small
> PHP page with just
>
> <?php phpinfo(); ?>
>
> in it, I get the expected information. This implies that PHP is
> running OK. I have tried a couple of other basic PHP scripts, and
> they seem to run OK as well. I went through the examples in the
> "simple tutorial" at www.php.net and got exactly the results
> predicted.
> However, if I try to run the pages I'm supposed to be installing, PHP
> doesn't run. The code in the file is sent to the browser as plain
> text. If I view the source of the page, I can see some (although not
> all) of the PHP code in there. If I rename the PHP to have a .html
> extension, it looks exactly the same. This sounds like the page is
> not being executed.
> For example, there is code like this in the page...
>
> <input type="text" name="db_user" value="<?=$CFG_db_user?>" />
>
> The browser shows a text box with <?=$CFG_db_user?> inside. Obviously
> the code isn't being executed.
>
> Does anyone have a clue what is going on here? I realise it may be
> hard without seeing the page, but it's not currently on a production
> server.
> If there's any more info I can supply, please let me know.
>
> TIA

He he, I could maybe use your help as I am having to do a few asp/MSSQL
pages and my experience is php/MySQL.

Anyway, your problem is that <? is what is called a "short open tag" and in
the more recent releases of php their use is disabled by default.

So instead of <?=$CFG_db_user?> use <?php echo $CFG_db_user;?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация