Submit Your Article Forum Rules

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Menu Management Software?

  1. #11
    Member MikeSzyszka's Avatar
    Join Date
    Apr 2004
    Location
    Woodstock, NY
    Posts
    51
    Sorry I have never used servers that did not allow SSI and should be more careful in my replies.
    Yes, I forgot to mention a .htaccess file is required. Here is what works for me

    AddType text/html .shtml
    AddHandler server-parsed .html
    AddHandler server-parsed .htm
    AddHandler server-parsed .shtml
    Options Indexes FollowSymLinks Includes
    ErrorDocument 401 http://bearsystems.com/nopassword.html
    ErrorDocument 403 http://bearsystems.com/forbidden.html
    ErrorDocument 404 http://bearsystems.com/nofile.html
    Thanks,
    Mike Szyszka
    Hidden Content

  2. #12
    Member
    Join Date
    Feb 2010
    Posts
    67
    Am now slightly confused again... apart from what the host server may / may not be set up for is there any effective difference (from user or google's point of view) between using SSI versus PHP to do it??

    PHP as suggested turned out to be easy to implement (apart from trying to put the include files anywhere other than root, which produced a path error about 'pear', so I put them back in root....)

    site is the one in my sig; http://www.equinepainting.co.uk/
    and is currently using

    Code:
    RemoveHandler .html .htm
    AddType application/x-httpd-php .php .htm .html
    in .htaccess
    and
    <body><?php include("header.htm"); ?>
    variable content here
    <?php include("menu.htm"); ?>
    </body>
    which seems to be generating pages that look / behave like static ones. Is there any disadvantage in doing it that way?

  3. #13
    Moderator HTMLBasicTutor's Avatar
    Join Date
    Apr 2010
    Location
    Canada
    Posts
    1,202
    I have mine set up like this:

    Included pcs are in a folder called includes.

    In .htaccess, after RewriteEngine On and my 301 permanent redirects fixing www vs non ww problem
    Code:
    AddType x-mapp-php5 .html .htm
    In the pages I have:
    PHP Code:
    <?php include($DOCUMENT_ROOT "includes/filename.txt"); ?>
    In the robots.txt I have the instruction to please stay out.

    If you put the included pcs in the root, then you have to solve the problem of stopping the search engines indexing.
    Hidden Content - Search engine friendly websites, ecommerce websites & blogs
    Hidden Content - Web page mistakes with solutions
    Hidden Content - HTML help to learn HTML basics

  4. #14
    Member
    Join Date
    Feb 2010
    Posts
    67
    currently have the individual include files disallowed in robots txt

    tried your suggestion
    EDIT: test page removed

    am back to
    Warning: main() [function.include]: Failed opening 'includes/header.htm' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') etc
    error for both includes/header.htm and menu.txt

    either there's something else missing in htaccess or that would seem to be a server set up problem... googling the error message brings up a load of stuff, none of which looks particularly helpful!
    Last edited by KatyS; 11-24-2010 at 02:12 AM.

  5. #15
    Moderator HTMLBasicTutor's Avatar
    Join Date
    Apr 2010
    Location
    Canada
    Posts
    1,202
    Then put it back the way you had it until you figure out what is wrong.
    Hidden Content - Search engine friendly websites, ecommerce websites & blogs
    Hidden Content - Web page mistakes with solutions
    Hidden Content - HTML help to learn HTML basics

  6. #16
    Member
    Join Date
    Feb 2010
    Posts
    67
    that was test page - also excluded.. but anyway yup not useful....
    Last edited by KatyS; 11-24-2010 at 02:13 AM.

  7. #17
    WebProWorld MVP williamc's Avatar
    Join Date
    Jul 2003
    Location
    On a really big hill in Kentucky
    Posts
    4,538
    KatyS the way you originally had it should be fine. If you want the menu file in a seperate folder just change the include to look something like this:

    Code:
    <?php include("includes/menu.htm"); ?>
    That is for pages that are in the root.

    If you have pages in say domain.com/somedirectory/page.html and you have the menu.htm in a folder called includes in the root you would use:

    Code:
    <?php include("../includes/menu.htm"); ?>
    etc.
    William Cross
    Hidden Content by Those Damn Coders
    Hidden Content because our constitution matters

  8. #18
    Member
    Join Date
    Feb 2010
    Posts
    67
    Code:
    <?php include("includes/menu.htm"); ?>
    was the first thing I tried but that gave same 'pear' error as above
    (I understand that much of concept of file positions and the ../ bit, going up from sub-pages does work, it's just that putting include files in folder is refusing to work...)


    have found this:
    http://techpatterns.com/forums/about87.html

    following instructions on that reply and adding
    php_value include_path ".:/home/users/*****/html/equinepainting.co.uk/includes"
    to .htaccess changes error message to:

    Warning: main() [function.include]: Failed opening 'includes/header.htm' for inclusion (include_path='.:/home/users/*****/html/equinepainting.co.uk/includes')
    but still isn't finding file....

  9. #19
    WebProWorld MVP williamc's Avatar
    Join Date
    Jul 2003
    Location
    On a really big hill in Kentucky
    Posts
    4,538
    Create a file named something like: phpinfo.php

    Add this one line to the file:

    Code:
     <?php phpinfo(); ?>
    Upload that to the folder you want the include file in, then aim your browser at phpinfo.php

    look for this Area in the displayed results:

    Environment

    Under that heading, look for the variable: DOCUMENT_ROOT this variable will tell you the exact server path to that directory, ie: /home/builder/public_html/dev or whatever it is for your servers setup. That will give you the full path for your include statement.

    When you are done, delete the phpinfo.php file as it contains information you will not want everyone seeing if it is found.

    Nifty little trick you may want to remember for future use.
    Last edited by williamc; 11-24-2010 at 06:35 AM.
    William Cross
    Hidden Content by Those Damn Coders
    Hidden Content because our constitution matters

  10. #20
    Member
    Join Date
    Feb 2010
    Posts
    67
    thanks for that - it didn't directly solve the problem.... but did inadvertently as I discovered in the process I couldn't access file inside
    /includes/ in browser either... despite ftp showing it in there.

    Think my host must have some sort of default setting effecting that folder name which stops the php instruction finding it too...!??

    changing folder name to /menus/ meant I could find and run the above ; which wasn't actually needed in the end as

    <?php include("menus/menu.htm"); ?>

    works fine without alteration to the .htaccess

Posting Permissions

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