Tuesday, 15 January 2013

html - PHP Include links -


Hello, I'm going to be your first serious with PHP to create a sample script for my own original structure, I have in my root folder:
  • index.php
  • The main folder (holds most of my fashion function files)
  • CSS
  • Sites (Other sites have 3 and folders site A, B, C)
  • Includes sites (holders to my header.php and footer.php) JS

    All Pages are created by including header.php and footer.php in the folder, and then have their contents between each page. Header.php includes (as well as links to the Basic HTML and Javascript Stylesheets Act) such as core folders include:

    • include_once '/core/connect.php';

      Now all of these work using index.php which provides links to 3 different sections of site, site, sitebank and sitcom.

      But when you call document root /sites/sitea/index.php all those links are now broken.

      Header. What is the best way to create links in the FTP section, so that relative site is wide, no matter what the folder you are in?

      The idea behind this is that you have only one file for each process

      Therefore process all pages via index.php

      In index.php, for example,

        will be required ('header.php '); ('Content.php'); ('Footer.php') is required;   

      In this way, if your content does not appear then it will not break the site.

      Your index is always loaded on the same path, so the header / footer will not change just the content.

No comments:

Post a Comment