pucker22 Posted August 30, 2006 Share Posted August 30, 2006 Hey all, recently i've been having some hazzle using a php script that uses / for my script directory, however as I am on a Windows server it has to be set to \When I change the / to \ in MacromediaDreamweaverMX08 The text colour that was red will now be black, so therefore the script wont work right.Basically my code is :-define('PEAR_DIR', 'C:\Inetpub\vhosts\domain.com\httpdocs/libs/Pear/');however I really need it to be straight forward to :-define('PEAR_DIR', 'C:\Inetpub\vhosts\domain.com\httpdocs\libs\Pear\');notice how I want it to be \ ?How would I go about doing this, what do I need to add to the end of it to make it work, because the ' only works with / at the end..I hope this makes somewhat sence.... Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/19165-instead-of/ Share on other sites More sharing options...
wildteen88 Posted August 30, 2006 Share Posted August 30, 2006 Use two \ (\\) for defining windows paths. It is becuase the \ is escaping the quote at the end of the define statement. Using \\ will helpl stop this. Quote Link to comment https://forums.phpfreaks.com/topic/19165-instead-of/#findComment-82902 Share on other sites More sharing options...
obsidian Posted August 30, 2006 Share Posted August 30, 2006 you need to escape the backslash because PHP thinks you're trying to escape the quote with it:[code]<?phpdefine('PEAR_DIR', 'C:\\Inetpub\\vhosts\\domain.com\\httpdocs\\libs\\Pear\\');?>[/code]i've escaped all of them, just for safety. try that out and see what it does. Quote Link to comment https://forums.phpfreaks.com/topic/19165-instead-of/#findComment-82903 Share on other sites More sharing options...
Jenk Posted August 31, 2006 Share Posted August 31, 2006 realpath() will be of use for cross compatability.[code=php:0]<?php define('PEAR_DIR', realpath('libs/Pear')); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/19165-instead-of/#findComment-83223 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.