How to Insert iFrame With PHP


PHP is a web development programming language used to create websites. It is an open source language, which means that it is free to use. It is often used with a MySQL database, which is also open source. An iFrame is a simple floating frame, placed on a website page, to include code from a separate source. The content within the iFrame can come from a separate file within the same site or from a separate website. You can use it to include posts from Facebook or Twitter.

  • Open Notepad and create a PHP file called "index.php."

  • Add the following code to the index.php page and save the file:


    <head>PHP IFrame<head>


    <h2><font face="arial" color="green"></font></h2>

    <Iframe src="include.php" width="300" height="600" border="1"></Iframe>



    You can change the width and height attributes of the iFrame tag to suit your website.

  • Create a new PHP file called "include.php" and add the following code:


    This code will show debugging information from PHP when it is included in the file. Save the file.

  • Open the index.php file in a browser and you will see that the php debugging code appears on the page, from the included PHP file.


  • Photo Credit Jupiterimages/Comstock/Getty Images
Promoted By Zergnet


You May Also Like

Related Searches

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!