php inside html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

Post by Jef Patat »

so,..., the conclusion is I should move hosting again?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I'd write an email. 'Dear customer support, ...'
Show them you already know what you want and how your problem can be solved. All you want to know is wether the server (their server) configuration allows it or not.

current state:
files with the extension .php are handled by the php module. files having .html are not.
I.e. the php script index.php works fine while the same file saved as index.html is delivered as-is (with php source code).
target state:
index.html (and all files having .html as extension) are handled by the php module.
possible solutions:
adding .html to the list of extensions associated with application/x-httpd-php

Code: Select all

AddType application/x-httpd-php .php .htm .html
as explained at http://httpd.apache.org/docs/2.0/mod/mo ... ml#addtype
question:
Does the server hosting my account reflect settings in .htaccess?
Do I have the required permissons?
If not do you provide an alternative to have .html files handled by php?
User avatar
SomeOne
Forum Commoner
Posts: 27
Joined: Tue Jul 25, 2006 2:06 am

Post by SomeOne »

i have the same problem with my hosting...though the prowider say it's cas of a security and CPU power...
8O
the SOURCE code of HTML file looks like this..

Code: Select all

<center>This is pure HTML</center>
 <?php echo "This is pure PHP"; ?>
 <center>This is pure HTML second time</center>
file is something.HTML
and i dont see PHP echo command....
if i change it to something.PHP the php code executes...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

exactly the same.
Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

Post by Jef Patat »

Is it a problem that their server is running in "safe mode"?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

no.
Jef Patat
Forum Newbie
Posts: 8
Joined: Tue Oct 03, 2006 1:59 pm

Post by Jef Patat »

volka wrote: Does the server hosting my account reflect settings in .htaccess?
Do I have the required permissons?
Can this information be read from the phpinfo page?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

no.
Post Reply