homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP line being resolved inside an HTML file
Resolving PHP lines inside HTML file w/o addtype
ehm01




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

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:
<?php
$mm_xsl2->setXSL("mynew.xsl");
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]

 

eeek




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

Can you do mod_rewrite stuff on your host?

wsmeyer




msg:3752254
 10:33 pm on Sep 25, 2008 (gmt 0)

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

William.

ehm01




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

"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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved