Solved

php in a html page, which has ssi

Posted on 2006-11-02
3
187 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 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