Reply to Re: [PHP] php-not-executing-in-html-file-help

Your name:

Reply:


Posted by Chris Shiflett on 11/15/82 11:11

vijayaraj nagarajan wrote:
> but this code doesnot give any output in the
> browser...
>
> file name: hi.html
>
> <html><body>
> <?php echo "hihihi"; ?>
> </body></html>
>
> but, the same file with the php code in it...could be
> executed in the command line, using php... where i am
> getting the expected output...
>
> i tested to c if my apache doesnt recognise php ...
>
> this code runs perfectly...in the browser...
>
> <?php echo "hihihi"; ?>
>
> if saved as hi.php file...
> the same code saved as .html, is not giving any output
> in the browser...
>
> kindly help me to figure out this problem...

I see no problem. It seems that hi.html is being treates as HTML, and
hi.php is being treated as PHP. No surprise there.

You can modify this behavior and make Apache treat .html files as PHP by
adding .html to your AddType directive in httpd.conf. Are you really
sure this is what you need?

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

[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

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