PHP Include

Discussion in 'PHP/MySql' started by bitane, Aug 5, 2011.

  1. bitane New Member

    Member Since:
    Jun 17, 2011
    Message Count:
    269
    Likes Received:
    0
    How would you include another HTML document with a different stylesheet in a document. I used to use iframes but now I can't since they are deprecated in HTML Strict.

    I know it has something to do with a php include function, but I believe those use the same stylesheet as the page it is on. Thanks

  2. MarPlo Member

    Member Since:
    May 12, 2011
    Message Count:
    66
    Likes Received:
    6
    Hy
    You can include the different stylesheet and the html document by using the sintax include('file.ext');
    Or you can set the stylesheet you want to use according to the html document you want to include, then include the html.
    For example:
    Code (text):

    if($file='some.html') {
      include('style1.css');
      include($file);
    }
    else {
      include('other.css');
    }
     
    It's just an example to give you an ideea, but depends on the php script of your site.
    1 people like this.

Share This Page