Solved

php in a html page, which has ssi

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

688 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