Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP line being resolved inside an HTML file

Resolving PHP lines inside HTML file w/o addtype

10:20 pm on Sep 25, 2008 (gmt 0)

5+ Year Member

Sorry if this was discussed here already.
I search and all responses were pointing to changing the Apache config line or redirecting to a .php file.

My server do not allowed me to have the
.htaccess file changed to
AddType application/x-httpd-php .html

So I had to discard that option.
Also, the page I'm talking about has many years of exposition. It's in thousands of links all over, so I really don't want to change it to #*$!.php

I have one line of PHP embedded inside my .html file that reads an XML file and displays it.

Is there any command that I can add at the beginning of my .HTML file that will make that php line run?

Basic, this is the line:
echo $mm_xsl2->Transform();

What I need is just run this, inside the .html file, w/o touching the apache configuration. Any chances to do it?

THank you all for the ideas.
Also, I'm new on this PHP and server issues, so be nice! :)

[edited by: ehm01 at 10:33 pm (utc) on Sep. 25, 2008]

10:21 pm on Sep 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Can you do mod_rewrite stuff on your host?
10:33 pm on Sep 25, 2008 (gmt 0)

5+ Year Member

If the XML file doesn't change very often or if it changes on a schedule you can setup a cron job to run a PHP script that reads a page.txt your page.xml and then write a page.html file


10:35 pm on Sep 25, 2008 (gmt 0)

5+ Year Member

"Can you do mod_rewrite stuff on your host? "

I'm not sure what is that, but basic I can't do much on my server.
If there is a solution, need to be done under my own folder on the server, not at Apache level.
Is that possible?