Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / how \\ backslashes work \\ in forums

Author
Message
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Sep 2003 01:00
use two \\ and only 1 \\ is removed \\

-RUST-
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Sep 2003 01:01
or am I the last one to find this out LOL
\\

-RUST-
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 3rd Sep 2003 01:27
Hmmm...
\\\\\\\\\\\\\\\\
////////////////

Hmm....

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 3rd Sep 2003 01:27
Half of the top ones were removed

--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 3rd Sep 2003 02:45 Edited at: 3rd Sep 2003 02:47
Weird... \\\\\\\\\\\\

Maybe the forum filters them out for some kind of security purposes?

"All programmers are playwrites and all computers are lousy actors" -Anon
[img]Visit my site![/img]
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Sep 2003 03:02 Edited at: 3rd Sep 2003 03:02
Maybe it's just the cgi interpretation. e.g to display a single quote you use

\\'

andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 3rd Sep 2003 03:28 Edited at: 3rd Sep 2003 03:39
I just remembered. PHP uses the "\\" character to escape other characters that do something. "$" means string. To display a "$", you need to escape, or display it as text, it with a "\\". To display a "\\", you escape it with "\\", making one half of them disapear. So it's not a bug, just the way PHP does strings.

$ - should look like a $. Looks like "\\$" in PHP.
" - should be a ". Looks like "\\"" in PHP.

"All programmers are playwrites and all computers are lousy actors" -Anon
[img]Visit my site![/img]
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 3rd Sep 2003 03:54 Edited at: 3rd Sep 2003 03:54
So really the forum software should scan posts for "\\" and replace it with "\\\\". Possably not worth the cpu load.
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 3rd Sep 2003 11:00
in theory \r the rest of this line should be on a new line in the source code.

Web Design Starting from $200. Special limited offer. MSN or Email me for more information.
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 3rd Sep 2003 11:01
my boo bo

Web Design Starting from $200. Special limited offer. MSN or Email me for more information.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Sep 2003 18:06
the only reason I noticed this was because I posted a code snippet somewhere and when i rem I use `\\\\ but when I looked at the code snippet after it was posted the rem statements had `\\

-RUST-
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Sep 2003 20:25
actually $ means a variable, not just string.

$
\$

Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 3rd Sep 2003 23:05
"actually $ means a variable, not just string."

Oh. I'm kinda new to PHP. I've only really used strings anyway.

"All programmers are playwrites and all computers are lousy actors" -Anon
[img]Visit my site![/img]
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Sep 2003 23:13 Edited at: 3rd Sep 2003 23:13
That's one thing I like about php : no enforcement of types



Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 4th Sep 2003 00:00
try posting a location in windows like

c:\\windows\\system32\\drivers\\whatever

and you get

c:\windows\system32\drivers\whatever

most annoying, its better to plonk them in the code snippet thingy maybe?

Mentor.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 4th Sep 2003 00:53 Edited at: 4th Sep 2003 00:55
Quote: "the only reason I noticed this was because I posted a code snippet somewhere and when i rem I use `\\\\ but when I looked at the code snippet after it was posted the rem statements had `\\"


-RUST-
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 4th Sep 2003 01:10 Edited at: 4th Sep 2003 01:14
never mind

"All programmers are playwrites and all computers are lousy actors" -Anon
[img]Visit my site![/img]
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 4th Sep 2003 16:06
I thought he mean`t like I post snippets I don`t use the snippets thing usualy, too much trouble, I just post the code in the thread direct, I thought the snippets function was supposed to leave the text untouched, my bad.

Mentor.

Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 8th Sep 2003 12:52
I've fixed this. I didn't notice it because it doesn't happen on the development server. Basically it wasn't PHP's fault totally - when you add data to SQL you have to slash the single quotes and when you read the data out again you strip the slashes from the data. However PHP on the live server had magic quotes enabled meaning it was stripping the slashes already. So I was then using stripslashes to do the same thing again which killed any extra slashes.

Anyway, it doesn't do it now

Cheers,

Rich

"Gentlemen, we have short-circuited the Universe!"
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Sep 2003 17:50 Edited at: 8th Sep 2003 17:51
hee hee - who knew this was an issue
Thanks Rich

-RUST-
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 8th Sep 2003 17:54 Edited at: 8th Sep 2003 17:59
Testing: This should be 3 slashes: \\\



Rich: popup source box still dont like backslahes.

Also, editing a post screws up backslahes.

Getting there though!

I'm writing a lot of PHP stuff for work and the difference between servers regarding magic quotes and register globals,e.t.c is quite annoying! I've had to edit php.ini on all of them so they are the way I like it.

The programmer formerly known as sonic
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Sep 2003 17:58
spookafied \\\

-RUST-
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 8th Sep 2003 18:27
spooky:

Register Globals???

Yeah i know what it is, but as of PHP 5 (I think) there will be NO register global option as it can be a security risk, i always use _POST, _SERVER, _GET, _SESSION, _COOKIE etc. As for magic quotes, a good developer should never need third party tools.

I know one guy who made a wonderfull site with third party tools, had to move server and the site fell to pieces, he lost hundreds of dollars in trade and clients leaving because the site would not work.

Nearly as bad as some plonkers who i host who dont back up their data.

Web Design Starting from $200. Special limited offer. MSN or Email me for more information.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 8th Sep 2003 19:43
Martyn Pittuck, yes, register globals is no longer recommended and will not be used in future versions but is confusing to the newbie when most examples on net insist you turn them on! I have made sure all my programs don't use them and use proper variables like _POST, _SERVER, e.t.c.

I also make sure all the magic quotes stuff is turned off as I hate things being done automatically as you are never sure what's going on.

The programmer formerly known as sonic
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 8th Sep 2003 21:53
if i get Rich's permission i may post some links to my new scripts

I got a DECENT database result splitter (Not the crumby phpbuilder ones which dont seem to count for there being 1000+ records.

I am also making a template system which should be fun, kinda hard as all the different pages can have a different design element like colour or text size.

For example the <title></title> tag will be replaces with [title] and read from the entry names title in the database, BUT if you view from the about page and if there is a title_about in the database that one is used if there is no title_about in the DB the defult is used.

i am also splitting a page into like 40 or 50 database records for 'easy' editing. And some dynamic page streamlined CSS so that with a huge site with 10k of CSS, only the CSS for that page is d/l.

Finally i am going to try to use some of these new MYSQL features like boolean search and the result cashing.

A big project, more a learnging curve than a logicaly designed site. I mean the site is going to be like 8 pages, but hopefully huge database.

Web Design Starting from $200. Special limited offer. MSN or Email me for more information.

Login to post a reply

Server time is: 2024-09-20 13:32:25
Your offset time is: 2024-09-20 13:32:25