Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusing slashes

 
egbai mmumene
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to set a directory on a php page but the book i'm using uses the back slash"/" instead of the front slash"\" although both aren't working in displaying my image
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64828
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
backslash = \
forward slash = /

Backslash is only used on Windows.
 
Nick Charles
Ranch Hand
Posts: 71
Linux PHP Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually use forward slashes (/) in file patchs because backwards slashes (\) are treated as escaped characters in PHP (and Java) strings and thus can lead to surprising results.

Of course, this doesn't solve the problem you are having. To solve that problem, change your file references to use the correct relative path. If you need more help than that, please post the code you are using, and also post the exact location of the file you are attempting to access (full path location for both the PHP file containing the code and the file being referenced, please).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic