Results 1 to 4 of 4

Thread: File Includes

  1. #1

    Thread Starter
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    File Includes

    I have the majority of my files in the root directory of the website with a include directory for any file includes needed.

    This works fine using:
    Code:
    include('include/file.php');
    However I also have another directory that contains files that also need these include files. I would have thought the following would work:
    Code:
    include('../include/file.php');
    But I get a Fatal error: Maximum execution time of 30 seconds exceeded in C:\home\****\include\file.php on line 10.

    On line 10 is the following code which works fine apart from when this include file is called in anything other than the root directory.

    Code:
    Line 10: session_register("s_custid");
    Help appreciated.

    DJ

  2. #2
    Addicted Member
    Join Date
    Nov 2003
    Posts
    137
    why not just make a var like so

    $the_file = $_SERVER["DOCUMENT_ROOT"]."/include/file.php";

    of course change the paths to suit your needs
    Live to love, Not to hate

  3. #3

    Thread Starter
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    I've tried that but $_SERVER["DOCUMENT_ROOT"] returns nothing i.e. "".

    Plus the error isn't (I don't think) related to not finding the file its just it times out for a page in a directory and not one in the root directory.

    DJ

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    The maximum execution time is to stop PHP becoming a runaway process. Is there any code in your scripts which could cause them to hang? e.g. infinite loops etc ...

    I would advise you add some debug echo statements to track down the exact point where the script hits a bottle kneck, you'll be half way toward solving your problem then.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width