Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Location
    Orkney Islands
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    open a template page along with an "inc file"

    Is there a way to activate a link that will open a template page along with an "inc file" with php code?

  • #2
    New Coder
    Join Date
    May 2009
    Location
    Cincinnati
    Posts
    45
    Thanks
    0
    Thanked 4 Times in 4 Posts
    We're gonna need a bit more information if we are going to help you.

    You just want to have a template page that includes another page?

  • #3
    New to the CF scene
    Join Date
    May 2009
    Location
    Orkney Islands
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes thats it, sorry but I'm new to all this and don't know all the correct terms and all my "inc files" are text only
    Last edited by yam38; 05-31-2009 at 08:55 PM.

  • #4
    New Coder
    Join Date
    May 2009
    Location
    Cincinnati
    Posts
    45
    Thanks
    0
    Thanked 4 Times in 4 Posts
    It's as simple as:

    PHP Code:
    <!-- Insert Doctype, head, etc here -->
    <?php include 'included_page.php'?>
    <!-- Close body, html here -->
    Is that what you mean? Or do you want to include the header and footer etc into the page?

  • #5
    New to the CF scene
    Join Date
    May 2009
    Location
    Orkney Islands
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I have a list on one page then you click on any of the links then it will open on a blank page with headers the lot + the "inc file"

  • #6
    New Coder
    Join Date
    May 2009
    Location
    Cincinnati
    Posts
    45
    Thanks
    0
    Thanked 4 Times in 4 Posts
    For each page, just use include() to include the headers/everything else.

    PHP Code:
    <?php include 'header.php' ?>
    Content for this page.
    <?php include 'footer.php' ?>
    If you change header.php or footer.php, the changes will be rendered across all the pages that include them.

  • Users who have thanked Relish for this post:

    yam38 (06-09-2009)

  • #7
    New to the CF scene
    Join Date
    May 2009
    Location
    Orkney Islands
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ok many thanx that seems so simple, I will try and see how this works for me : )

  • #8
    New Coder
    Join Date
    May 2009
    Location
    Cincinnati
    Posts
    45
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Glad I could help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •