coderdj412 Posted July 30, 2012 Share Posted July 30, 2012 How can I fix this? File Location (where directory.php is located): C:\xampp\htdocs\hfmw\chapter7\tartans PHP code: define('TARTAN_DOC_ROOT', '/' . ltrim(substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])), '/')); define('PUBLIC_TARTAN_DIR', rtrim(TARTAN_DOC_ROOT, '/') . '/tartans/'); directory.php: echo PUBLIC_TARTAN_DIR . '<br />'; Results: /\hfmw\chapter7/tartans/ Quote Link to comment https://forums.phpfreaks.com/topic/266470-fixing-double-slashes-in-windows-path/ Share on other sites More sharing options...
DavidAM Posted July 30, 2012 Share Posted July 30, 2012 Try using the PHP constant: DIRECTORY_SEPARATOR instead of using "/". The constant contains the appropriate value (forward-slash or back-slash) for the operating system. Quote Link to comment https://forums.phpfreaks.com/topic/266470-fixing-double-slashes-in-windows-path/#findComment-1365518 Share on other sites More sharing options...
coderdj412 Posted July 30, 2012 Author Share Posted July 30, 2012 Try using the PHP constant: DIRECTORY_SEPARATOR instead of using "/". The constant contains the appropriate value (forward-slash or back-slash) for the operating system. DavidAM, It's not working. I am using XAMPP. I am getting tons of error messages. Quote Link to comment https://forums.phpfreaks.com/topic/266470-fixing-double-slashes-in-windows-path/#findComment-1365528 Share on other sites More sharing options...
requinix Posted July 30, 2012 Share Posted July 30, 2012 Then maybe you should tell us what they are so we can help you fix them. Quote Link to comment https://forums.phpfreaks.com/topic/266470-fixing-double-slashes-in-windows-path/#findComment-1365536 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.