Solved

php in a html page, which has ssi

Posted on 2006-11-02
3
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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…
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 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