homepage Welcome to WebmasterWorld Guest from 54.161.147.106
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Problem with phrasing html file as php
NeedScripts




msg:1283006
 3:13 pm on Dec 3, 2002 (gmt 0)

I am having little (or big) problem with using php code on a .html file.

I did added

AddType application/x-httpd-php .html

in the .htaccess file, but whenever above code is present in the .htaccess file, it does not allow users to view the pages, instead it is asking for download/save the file on computer.

I was wondering if someone can help me out.

P.S... current .htaccess file looks like

AddHandler server-parsed .html
AddHandler server-parsed .htm

 

NeedScripts




msg:1283007
 3:20 pm on Dec 3, 2002 (gmt 0)

I think I figured out the problem. If .htaccess file has both

AddType application/x-httpd-php .html
AddHandler server-parsed .html

in it, it will not work and I guess hence the problem.

Now can anyone tell me how can I phrase SSI and PHP on .html page? without facing this problem?

Thanks for the help.

Marcia




msg:1283008
 3:32 pm on Dec 3, 2002 (gmt 0)

I don't know how to put it together with PHP, but mine looks like this:

AddHandler server-parsed .html .htm .shtml

NeedScripts




msg:1283009
 3:49 pm on Dec 3, 2002 (gmt 0)

If I am not wrong

AddType application/x-httpd-php .html
is used for using php code on page.html type of pages

&

AddHandler server-parsed .html
is used to use SSI code on page.html type of pages.

I have not used
AddHandler server-parsed .html .htm .shtml
But I think what it does is will allow you to use SSI code on .html .htm and .shtml pages. But then there is no need to put .shtml at the end, cuz, .shtml pages can anyway use SSI.

But still the problem of using both .php and ssi on a .html page stands :(

jatar_k




msg:1283010
 6:54 pm on Dec 3, 2002 (gmt 0)

You can't. One parser or the other not both.

You shouldn't need to anyway, you can use php to do all of the same things ssi does.

I use a setup like this

.htm - plain vanilla html
.html,.php - php parsed
.shtml - ssi

seindal




msg:1283011
 6:56 pm on Dec 3, 2002 (gmt 0)

I don't think it is possible to have files processed by two modules at the same time, so you can't have both SSI and PHP on the same files.

PHP has the same abilibites as SSI in terms of file inclusion and conditionals, so all you need is PHP.

René.

andreasfriedrich




msg:1283012
 7:27 pm on Dec 3, 2002 (gmt 0)

You can chain handlers when you access the Apache API directly. mod_perl lets you do that (yeah) :) mod_php does not (sucks) :( You could write a little C program to to that as well.

Andreas

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