Jump to content

\ instead of /


pucker22

Recommended Posts

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!
Link to comment
https://forums.phpfreaks.com/topic/19165-instead-of/
Share on other sites

you need to escape the backslash because PHP thinks you're trying to escape the quote with it:
[code]
<?php
define('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.
Link to comment
https://forums.phpfreaks.com/topic/19165-instead-of/#findComment-82903
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.