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 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts

    include has stopped showing and ideas

    Hi All,

    I have a simple code like example which adds a PHP include to a standard html web page. These have been fine for a few years. As of at least today none of the include show on any pages.

    Has there been a rule change for the 'include', as none of the pages have been revised to cause an issue.

    PHP Code:
    <html>
     <body>

     <div class="leftmenu">
     <?php include 'menu.php'?>
     </div>

     <h1>Welcome to my home page.</h1>
     <p>Some text.</p>

     </body>
     </html>

    Martin.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,539
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    Do you get any errors, or just nothing happens?
    Or do you get just a blank white screen?

    "stopped showing" is vague.

  • #3
    New Coder
    Join Date
    Mar 2012
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    Do you get any errors, or just nothing happens?
    Or do you get just a blank white screen?

    "stopped showing" is vague.
    Hi,

    Sorry about that.

    Where the include tag is positioned there should be a set of links appear. Those links do not show, so that would be the area where the links should appear is blank, all the rest of the page is fine.

    These links in the location and the include tag on page have been there and working for a few years. The last seen set of links was on the 16th of April 2014 and are seen in a screen shot od the page at that time.

    The rendered page is devoid of any content where the include tag was and should have been replaced by the set of links.

    I checked the address in the include which of course has not changed for years and also copied it and pasted into a browser, that pasted address goes directly to the location where the file is stored that would have shown the links on page and that file with it's code is sitting there just fine.

    The non showing of the links is on every page where the include is placed, not just one page gone crazy. It is a real puzzle.


    Martin.

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,441
    Thanks
    11
    Thanked 305 Times in 304 Posts
    A couple things to check:
    - Is this page named something.html, or something.php? If it's an html page, you need a .htaccess file to tell the php processor to process .html files - see if such a file exists
    - Is any other php working on this page, or is this the only php component?
    - Have you changed servers, or moved these files into a different directory recently?
    - Has the server data been restored recently from a backup?

  • #5
    New Coder
    Join Date
    Mar 2012
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    A couple things to check:
    - Is this page named something.html, or something.php? If it's an html page, you need a .htaccess file to tell the php processor to process .html files - see if such a file exists
    - Is any other php working on this page, or is this the only php component?
    - Have you changed servers, or moved these files into a different directory recently?
    - Has the server data been restored recently from a backup?
    Hi,

    Well this is all very strange. The links have just appeared on all the pages they were missing from and no coding or files were changed.

    In answer to your questions. There are a mix of files both .html and .php which have different 'include' on them. To be honest there has never been any special additions to the .htaccess file for the .html page which all seemed to have worked fine in the past. This issue happened on both .php and .html pages. I would be interested if you can indicate what content I should put in the .htaccess file for the .html named files.

    As I said all strange, but something that was done and it cannot be said this was before or after the links returned, was that the .htaccess file on the host server was opened to check it's content to see if somehow a block was placed there for the include but that showed nothing out of line.

    I cannot say if the host had a bit of downtime which required a server restore, but nothing local was restored.

    I am fine to put this down to 'I don't know' because without any way to repeat the loss of links or until it happens again all things look and act as they should.

    Martin.

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,539
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    What is the filename of the included file?

    I'm curious if it's .html or .php

    Make two test files, one of each and try them both in the include one by one.

  • #7
    New Coder
    Join Date
    Mar 2012
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    What is the filename of the included file?

    I'm curious if it's .html or .php

    Make two test files, one of each and try them both in the include one by one.

    Hi mlseim,

    I sure you are wondering because of course normally an include won't work in a normal .html page.

    The pages are a mix, some are actual .php and those others are .html pages but have an iFrame loading a .php which in turn has the include in it.

    This whole event is still very puzzling because all was fine, then it was not and now everything is fine again on all pages and no changes were made anywhere and no indication of anything happening on host.

    However, Tracknut's suggestion did get me to look up how to make .html pages show the include by use of the htaccess file directing the pages to the PHP processor, if I ever wanted to do that.


    The name of the include files are various but have the file extension of .txt, so would be something like afilename.txt Do note that all this has worked for a few years so the names and extension cannot be all that bad unless a 'use of' rule has changed or something like that.

    Martin.
    Last edited by SpidersWebHelp; 04-25-2014 at 11:28 AM. Reason: forgot a bit


  •  

    Posting Permissions

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