So, we create websites that need to be ported from local development servers, to a test server, and then to a live server. For this reason, we created a variable:
<?php $path = '/_Folder_/_SubFolder_'; ?>
When we move a website from a server to another, the idea is to simply change the definition of $ path to re-equip a new development server. Currently, on every page, when we call include, we write:
<?php include('../_includes/_css.php'); ?>
but I am trying to do this:
<?php include($path.'/_includes/_css.php'); ?>
my result I hope this is:
<?php include('/_Folder_/_SubFolder_/_includes/_css.php'); ?>
I failed, resulting in:
Warning: include (/ Folder / _SubFolder _ / _ includes / _css.php) [function.include]: could not open the stream: there is no such file or directory in C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ htdocs \ FREEDOM2012_FREEDOM2012_DEFAULT_ \ accommodation \ guest-rooms.php on line 15
Another problem I still need to turn on the variable source by calling "../"
<?php include('../_includes/_var.php'); ?>
If anyone finds out how I could do this more efficiently, I would be very grateful. Thank you so much for your time, patience and effort in the response.
source share