Re: .php extensions versus .html

From: Date: Fri, 31 Jan 2003 08:32:34 +0000
Subject: Re: .php extensions versus .html
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133746@lists.php.net to get a copy of this message
I think what you've seen is shtml / ssi / server side includes, but anyway, since you asked: 1. create a .htaccess file which pushes *all* .php pages through PHP I *THINK* the code is something like: <Files ~ "\.html$"> ForceType application/x-httpd-php </Files> But you should check the apache manual, list or some tutorials. 2. change your code to: <html> <head> <title>Untitled</title> </head> <body> HELLO WORLD!!! <P> <?php include("helloworld2.php"); ?> </body> </html> Why can't you just use the .php extension? Justin on 31/01/03 5:46 PM, Guru Geek (gurugeek2002@g-i-w-s.com) wrote: > I was wondering, can you call a php script in the middle of a html page? > > I've seen some sites use code like this: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > > <html> > <head> > <title>Untitled</title> > </head> > <body> > HELLO WORLD!!! > <P> > <!--#include file="helloworld2.php" --> > </body> > </html> > > but when I try it, the php script doesn't run. > > > Does anyone else know how to use php on a page and yet keep the .html > extension? > > Thanks in advance, > Roger > >

« previous php.general (#133746) next »