Re: php-not-executing-in-html-file-help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux