How to include one page in your index? Or maybe just part of it, or call to bring specific php file to be executed?

……………………………………
IFRAME
Easy way to include whole page is simple iframe tag. It is handy as you can insert external source file. You can also change settings like:
scrolling=”auto”
scrolling=”no”
scrolling=”yes”
border=”0
and obviusly width=”x” and height=”x”
For example:
<iframe src ="https://pin55.com/index.php/phphtml-schoolz-part-2/" width="100%" height="300">
</iframe>
for full list of iframe tag aptional attributes visit:
http://www.w3schools.com/TAGS/tag_iframe.asp
……………………………………
INCLUDE
Without understanding much about the details of PHP, you can save yourself a great deal of time with the use of the PHP include command. include takes a file name and simply inserts that file’s contents into the script that issued the include command.
<?php include("menu.php"); ?>
Why is this a cool thing? Well, first of all, this means that you can type up a common header or menu file that you want all your web pages to include. When you add a new page to your site, instead of having to update the links on several web pages, you can simply change the Menu file.
Say we wanted to create a common menu file that all our pages will use. A common practice for naming files that are to be included is to use the “.php” extension. Since we want to create a common menu let’s save it as “menu.php”.
menu.php Code:
<html> <body> <a href="http://www.example.com/index.php">Home</a> - <a href="http://www.example.com/about.php">About Us</a> - <a href="http://www.example.com/links.php">Links</a> - <a href="http://www.example.com/contact.php">Contact Us</a> <br />
Save the above file as “menu.php”. Now create a new file, “index.php” in the same directory as “menu.php”. Here we will take advantage of the include command to add our common menu.
Index PHP code:
<?php include("menu.php"); ?>
<p>This is my home page that uses a common menu to save me time when I add
new pages to my website!</p>
</body>
</html>
And the result:
……………………………………
REQUIRE
require() is identical to include() except upon failure it will also produce a fatal E_ERROR level error. In other words, it will halt the script whereas include() only emits a warning (E_WARNING) which allows the script to continue.
<?php
require("menu.php");
echo "Menu!";
?>
INCLUDE () and REQUIRE (). The difference between them is that when placed within a false conditional statement, the INCLUDE is not pulled but the REQUIRE is pulled and ignored. This means that in a conditional statement it can be faster to use INCLUDE.
Sample of those command can be found here:
