Re: Include php from html



*** Luke Bellamy wrote/escribió (28 Apr 2005 20:16:29 -0700):
> I would like to put the PHP hit counter on the web site that only
> contains html files. Anyone have a good idea how I can do this without
> chaning all the files to .php?

You can instruct the webserver to pass *.html files through PHP
interpreter. If you are using Apache you may be able to use an .htaccess
file (unless prohibited by sysadmin):

# For Apache 2:
<Files *.html>
SetOutputFilter PHP
SetInputFilter PHP
</Files>


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
.



Relevant Pages

  • Re: Shared Apache Server Security from Others on Server
    ... > xx4) to be served up as html files or as php code. ... > shares this server with me can read all of my files using their ftp account. ... run Apache as root, it would introduce new security risks. ...
    (comp.os.linux.security)
  • Re: Noob - php works as .php but not when part of html
    ... Even with HTML intermingled amongst the PHP code, ... Of course you could tell apache to parse .html files as .php, ... > I did the install for both Apache and PHP via Mandrakes built in rpm ...
    (comp.lang.php)
  • Re: Parsing PHP with HTML file extension
    ... your files to .PHP so they would be parsed correctly. ... then "Apache Handlers" ... But passing full HTML files through PHP gives your server a lot of ... Your server must now read the WHOLE html file and check if it contains ...
    (comp.lang.php)
  • Re: [kde] Konqueror file association
    ... On 1/21/07, Kevin Krammer wrote: ... > working with PHP and HTML files and I love Kate as my text editor so I ...
    (KDE)
  • Re: redirect / new website how to redirect old (google) links to new site ?
    ... But why use PHP for some other function such as processing form data. ... to process *all* .html files as php files is an unnecessary overhead. ... That's what a server is for. ... You only need an extension if you directly map a URL onto the server's ...
    (comp.lang.php)