I'm a newbie here trying to figure out why my simple php code is not working inside html. Files with .php extension however works fine.The page is just blank. I modified the following line
"AddType application/x-httpd-php .php" in http.conf to "AddType application/x-httpd-php .php .html"
I tried adding these lines to .htaccess file.
AddHandler x-httpd-php .html .htm
AddHandler php-script .php .html .htm
AddHandler php5-script .php .html .htm and
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html as said in most of the forums. Nothing seems to work. Please someone help me out.I'm using wamp server 2.2 and php 5.
Recommended Answers
Jump to PostIf you haven't come across this resource already, I found it useful:
http://www.velvetblues.com/web-development-blog/how-to-parse-html-files-as-php/It talks about the type of handler you need to use based on whether you have one or multiple versions …
Jump to Post@rotten69 - because you can tell the web server to parse HTML files for PHP before serving the content to the browser.
Browsers do not understand PHP, even in PHP files. It's a server side scripting langauage. So even in PHP files, the file is parsed and only resulting output …
All 8 Replies
simplypixie
123
Posting Pro in Training
blocblue
commented:
That's incorrect.
+0
blocblue
238
Posting Pro in Training
Featured Poster
rotten69
20
Posting Whiz
simplypixie
commented:
Much better explanation than mine :-)
+7
blocblue
238
Posting Pro in Training
Featured Poster
rotten69
20
Posting Whiz
pritaeas
2,080
¯\_(ツ)_/¯
Moderator
Featured Poster
blocblue
238
Posting Pro in Training
Featured Poster

diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.