Oh, easy. You can't without having the page as a .php.
You can include in html, but you can't include a php that runs into a standard html. As far as I know.
You can include a .php into another .php, however.
EDIT
so you can have index.php which draws from sidebar.php... in sidebar.php there is just a defined function that echos out what you need and does all the processing.
then you can call it in index.php anywhere you want.
EDIT 2
<?php
include 'sidebar.php';
?>
that would include it. you could also not have a function in sidebar.php and just include it where on the page you want it...
that is how www.omgwtflmao.com/index2.php 's includes work... each major section is just called straight in.. in the order I want them to float above eachother (as divs)
You can include in html, but you can't include a php that runs into a standard html. As far as I know.
You can include a .php into another .php, however.
EDIT
so you can have index.php which draws from sidebar.php... in sidebar.php there is just a defined function that echos out what you need and does all the processing.
then you can call it in index.php anywhere you want.
EDIT 2
<?php
include 'sidebar.php';
?>
that would include it. you could also not have a function in sidebar.php and just include it where on the page you want it...
that is how www.omgwtflmao.com/index2.php 's includes work... each major section is just called straight in.. in the order I want them to float above eachother (as divs)