How to Insert iFrame With PHP

Save

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:

    <html>

    <head>PHP IFrame<head>

    <body>

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

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

    </body>

    </html>

    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:

    <?phpinfo();?>

    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.

References

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

Comments

You May Also Like

Related Searches

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