Solved

php in a html page, which has ssi

Posted on 2006-11-02
3
186 Views
Last Modified: 2008-01-09
Hi there :-)
here's a tricky one...
I got this html page which contains some ssi which work fine.
I also just got some php on that html page and it's not being processed...

I added in the line to my htaccess
AddType application/x-httpd-php .html

but still no go, and that is because I have these lines in there (so the ssi get processed)

AddType text/html .html
AddHandler server-parsed .html

Soo my htaccess looks like this
AddType application/x-httpd-php .html
AddType text/html .html
AddHandler server-parsed .html

If I have only the
AddType application/x-httpd-php .html

in my htaccess the php goes fine.

How can I get the php and ssi to work in harmony?
0
Comment
Question by:wildzero
  • 2
3 Comments
 
LVL 6

Assisted Solution

by:soapergem
soapergem earned 300 total points
ID: 17864690
Is there a reason you have to use the .html extension for these files? If nothing else, couldn't you save them as .php files, and then use mod_rewrite (in Apache) to make them *appear to be* .html files?
0
 
LVL 6

Assisted Solution

by:soapergem
soapergem earned 300 total points
ID: 17864692
And if nothing else, you could always just use PHP to include the files, instead of using SSI.

Something like this:

    <html>
    <?php
    include('./page2.html');
    ?>
    </html>
0
 
LVL 16

Accepted Solution

by:
HackneyCab earned 200 total points
ID: 17871269
You can't use SSI and PHP in one file served by Apache 1.3.

Apache 2 is supposed to be able to do this, but I don't use Apache 2, so I can't test this.

Just do as soapergem says, and use PHP's include or require statement to load content into a page.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now