Here's the problem:
Like most, I'm developing on an office network server, "localhost", and migrating pages to a live server on the
web.
I have several layers of folders with pages that refer back to "localhost/incudes" and "localhost/images" for
example using "../../../includes/key.php" for example.
I have coded the following to try to connect to the desired folders for 'include' operations, but it doesn't
work and I don't know why.
Here is the code that heads the pages I am working on.
<?php
error_reporting(E_ERROR|E_WARNING);
session_start();
$srclocation = $_SERVER['SERVER_NAME']."/includes/key.php";
echo $srclocation;
include ($srclocation);
?>
The variable '$srclocation' looks correct in the echo command but I must be missing something.
The error messages on the pages read as follows:
localhost/includes/key.php
Warning: include(localhost/includes/key.php): failed to open stream: No such file or directory in C:\xampp
\htdocs\lev1\lev2\lev3\page.html on line 6
Warning: include(): Failed opening 'localhost/includes/key.php' for inclusion (include_path='.;C:\xampp\htdocs
\includes') in C:\xampp\htdocs\lev1\lev2\lev3\page.html on line 6
It would be nice to make this work as it looks like it would simplify migrating pages to the live web site.
Thanks for any help and information
Dougsix@earthlink.net