Irfaan
Irfaan

Reputation: 105

PHP not working on html anymore

I have a website consisting mostly of html webpages. In order to allow me to use php in them, in my .htaccess file I added a bit of parsing code. A few days ago the php somehow stopped being executed and I'm still not sure why. I googled a few things and tried a few different types of parsing code but nothing seems to work. At the moment I have this line in my .htaccess file:

AddType application/x-httpd-php .html .htm

I have noticed one thing though, the php works fine at http://turkishbasics.com (my site's home page) but doesn't work at all for any other directories like http://turkishbasics.com/index.html or /contact.html

I contacted the hosting company, the guy mentioned something about Apache.?

Just how do I solve this problem?

Thanks

Upvotes: 3

Views: 340

Answers (2)

Zevi Sternlicht
Zevi Sternlicht

Reputation: 5399

If you havent yet heard of Apache then this might be a bit above you. Skip out the AddType decleration and just save your files with a .php extension instead of html

Upvotes: 1

Prasanth Bendra
Prasanth Bendra

Reputation: 32750

To excute php code you need to write it in a php file (.php). Then execute the file in server.

You can not execute php code from html file (.html)

I guess when you execute http://turkishbasics.com it takes from http://turkishbasics.com/index.php

Upvotes: 0

Related Questions