Forum Moderators: coopster
In my HTML file I have the following code:
<?php include("<counter/counter.php");?>
Now I have read several threads here on Webmaster World, and I have concluded that I need to create a ".htaccess" file, and place the following code in it:
AddType application/x-httpd-php .php .htm .html
But, once I have done this, every time I visit a page on my site, I get the Open/Save this file dialog. It seems like the server is telling my browser, to open all HTML files with the external application called "application/x-httpd-php".
So, adding that line to my .htaccess file ruins my entire website. I need to know what to do to allow PHP code to be parsed from an HTML file.
My webhost is GoDaddy.com, and I am using a Shared Server, so I do not have direct access to the "httpd.conf" file. In fact, when I log on through FTP, I don't even see a "Public_HTML" folder. I just see all my files from my site. I don't know if I need to call GoDaddy and ask to have them change my httpd.conf file, or if I should do something else. I have tried everything I can think of.
My Apache Server is version 1.3.31, and it is running PHP version 4.3.11.
Thanks in advance for any help. I appreciate it very much! Thank you!
Try this thread for more info:
[webmasterworld.com...]
But I think mod_rewrite is supported, because my changes to the .htaccess file are causing changes to the way the code on my pages is being parsed. Unfortunately the changes are bad. I get the open/save diaolog when viewing an HTML page.
But because I could change the way code is parsed doesn't that mean that mod_rewrite is supported?
I am not 100% sure but even then please do this:
What you are trying is good way to parse php in html files, i mean putting AddType code in .htaccess is good but you notice you are trying to put Two values of AddType in one line, Thats AddType , not AddTypes.
you already have the solution,, you just need to do remove your line from your htaccess and paste these,
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
See you need to define them seperately.
Simple!
and i am pretty much sure that thats the reason for that file open save dialogue box.
Leme know if it helped.
Thanks
Kamran
Well, the whole reason I needed help was to implement a PHP web counter in an HTML page. But, I have found a javascript/cgi solution, that doesn't need PHP.
But thanks for all the help. I appreciated it.