Jump to content


Photo

Extra backslash when passing variables


  • Please log in to reply
3 replies to this topic

#1 alt

alt
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 September 2006 - 08:44 PM

Hi, don't suppose anyone can tell me why when I pass this variable:

pgtitle=Coast to Coast '06: post4

in the following address:

http://mpk.kicks-ass.org/jimmyjudas/06coasttocoast/picture.php?src=a.jpg&pgtitle=Coast%20to%20Coast%20'06:%20post4&page=2

it displays the title with an extra backslash in, i.e. "Coast to Coast \'06: post4" instead of just "Coast to Coast '06: post4"? However, if you take the apostrophe out of the '06, it displays fine, like here:

http://mpk.kicks-ass...6: post4&page=2

It seems that it's interpreting %20' as a space AND a backslash. All seems a bit odd to me.

Oh, and you can see the php here:

http://mpk.kicks-ass...picturecode.txt

Thanks!

#2 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 12 September 2006 - 11:04 PM

The single quote causes the addition of the backslash. You can remove it by issuing the PHP stripslashes command. See PHP documentation  http://nl3.php.net/m...tripslashes.php.

Ronald  8)
RTFM is an almost extinct art form, it should be subsidized.

#3 alt

alt
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 13 September 2006 - 05:31 PM

Woo. That explains it. Thanks!

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 September 2006 - 07:39 PM

example for you an easy one

$redarrow=stripslases($_POST['redarrow']);
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users