What is the PHP code to load a page’s code into another?

Posted by: admin  :  Category: PHP Code

I used to use this code but I forgot it.

It basically loads the coding of an HTML file into the .php website.
For example, you can place the code in index.php and link it to "text.html" and in "text.html" type <br>text, and it will take that and place it on index.php.

Thanks.

Shiver me timbers!! I see we have yet another scurvy buccaneer navgatin’ th’ Seven Seas of PHP!

If it be loadin’ HTML in PHP ye want, then it’ll be th’ include function ye’ll need! Arrrgh, this function be loadin’ anothr’ PHP or HTML page and includin’ it on th’ server side!

Here’s a taste of th’ booty:

<?php
include("yourfile.html");
?>

May yer sails fly full!

Captain Lars of the Good Ship #000000 Perl


3 Responses to “What is the PHP code to load a page’s code into another?”

  1. DzSoundNirvana Says:

    include(‘path_to_file’);
    include_once(‘path_to_file’);
    require(‘path_to_file’);
    require_once(‘path_to_file’);

    i would use require once so if an error occurs the script will stop running.
    References :
    http://us2.php.net/manual/en/function.require.php

  2. Lars Anonymous Says:

    Shiver me timbers!! I see we have yet another scurvy buccaneer navgatin’ th’ Seven Seas of PHP!

    If it be loadin’ HTML in PHP ye want, then it’ll be th’ include function ye’ll need! Arrrgh, this function be loadin’ anothr’ PHP or HTML page and includin’ it on th’ server side!

    Here’s a taste of th’ booty:

    <?php
    include("yourfile.html");
    ?>

    May yer sails fly full!

    Captain Lars of the Good Ship #000000 Perl
    References :

  3. NONAME Says:

    ?< php >

    include(page.html)

    < php >?

    this is the correct code bye
    References :