Results 1 to 4 of 4
  1. #1

    PHP Layout Setup, Help

    Ok Ive figured out im going to do my layout in php and use the Include command, instead of my old way ...Iframes. uhgh. I have some questions though. I think I basically understand how it works, But I have a few questions. Say you make a navigation with the links Images, Staff, and About. , And on the main template you use the include command to include that page there. How would I make a new page for the images that still have the include navigation page on it. I figure you would have type the includes on every new page you make. I hope you guys understand what Im trying to say.

    This may help further. In Iframes in the link you made. you use the target= command in the link to tell the link to goto the designated iframe. Im wondering if there is something similar to this in the include command in php. Here is a link to an example tutorial I found[/URL] (in this tutorial it shows you how to do it but does give u example pages like page 2, so you know how to link it and code the page 2.

    Really hope i didnt confuse you guys. And im sure someone knows what im talking about.


  2. #2
    You confused me.
    Can you reframe the question? .. I'm afraid I can't get it right..

  3. #3
    OK, with IFrames you include the content within the layout essentially, and your menu changes the content of the IFrame.
    With PHP Includes you include the layout around the content.
    So, for every new page you include your layout files, so:

    {php include for header stuff goes here}
    Content here
    {php include for footer stuff goes here}

    Your menu points towards each new page as in a standard HTML site, and you just include your layout on every new page.

    Er, does that make sense?

    So, you have your navigation page, say nav.php, and your content pages called Images.php, Staff.php and About.php. On each of the content pages you include using <? php include ("nav.php"); ? > (minus appropriate spaces!)

    Your nav.php page links are just Images.php, Staff.php and About.php. And any layout stuff you want on all pages. Think of it an IFrame like a TV where your menu (remote) changes the IFrame (screen) & leaves the layout (room) the same, and a Include layout like a, um, blue-screen (layout) film where the content (content) changes and the blue-screen is added afterwards...

    That's a really bad metaphor...

  4. #4
    So If im correct your saying on every new page that I link to. I put the Includes on them? If so I think I Understand that. So in that case I could just save a document that already has the includes in them and just automatically add the content to it. Which should be considerably easy. Hopefully I got it.

Posting Permissions

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