DIRECTORY_SEPARATOR on windows correct path
Posted: Fri Aug 27, 2010 12:05 pm
Can someone please help with writing the path correctly using the DS so I can upload and write to file folder to the right place. I can't seem to get it to work. Thank you in advance ... Alex
I am using localhost on windows machine.
The path on my machine is:
// C:\wamp/www/photo_gallery/public/images
// C:\wamp/www/photo_gallery/includes/config.php and other files
I am using localhost on windows machine.
The path on my machine is:
// C:\wamp/www/photo_gallery/public/images
// C:\wamp/www/photo_gallery/includes/config.php and other files
Code: Select all
<?php
// Define the core paths
// Define them as absolute paths to make sure that require_once works as expected
// DIRECTORY _SEPARATOR IS A PHP pre-defined constant
// (\ for windows, / for Unix)
defined('DS') ? null : define('DS'), DIRECTORY_SEPARATOR);
// need help here
defined('SITE_ROOT') ? null :
define('SITE_ROOT', .DS.'wamp'.DS.'www'.DS.'photo_gallery');
// need help here
defined('LIB_PATH') ? null : define('LIB_PATH', SITE_ROOT.DS.'includes');
// load config file first
require_once(LIB_PATH.DS."config.php");
// load basic functions next so that everything after can use them
require_once(LIB_PATH.DS."functions.php");
?>