Php inside Html static page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
edilsonlauro
Forum Newbie
Posts: 1
Joined: Mon Nov 07, 2011 1:48 am

Php inside Html static page

Post by edilsonlauro »

Hi everyone,

Just simply question if anyone can help me...

what i need is a simply way to put php code into .html page

-------------
<?php
// Requiring file
require_once ("config/con_db.class.php");
require_once ("function/function.php");
require_once ("class/pagination.class.php");
/** Connect to database */
$connect = new db();
/** Include the header */
require_once ("templates/header.php") ?>

MY CONTENT CONTENT HERE THEN

<?php include('templates/footer.php'); ?>
-----------------

I don´t want change mod_rewrite and .htaccess, it's just a simple way to call this commands from html


thanks
Edilson
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Php inside Html static page

Post by twinedev »

Well, if you are not wanting to do a mod_rewrite or put anything into .htaccess to tell it to treat .html as a PHP file, then your only alternative is to alter httpd.conf to tell it that .html should be processed as php files. (However, if you are not willing to do it in .htaccess for a directory, you are probably not wanting to do it for the entire server...)

-Greg
Post Reply