Warning: include(hcrheader/header.php) [function.include]: failed to open stream: No such file or directory in

How do i change it so that the php include will work without having to move the files or duplicating the php files that i want to include. there should be a php include code for this but not sure what it is.

    You can add the entire search path using $_SERVER["DOCUMENT_ROOT"], something like this:

    include($_SERVER["DOCUMENT_ROOT"] . "hcrheader/header.php");

      Personally in my config or index file I create a variable for the full path of my includes. something like:

      $incpath = 'C:\wamp\www\includes\\';
      
      // or on linux
      $incpath = '/usr/bin/www/includes/';
      
      // the to include files:
      includes ($incpath .'header.php');
      

      Or along those lines, its up to you.

        Write a Reply...