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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.