Strange behaviour with " char
Strange behaviour with " char
am 29.10.2007 11:58:47 von darioros
[Correction about previous]
Hi. I found a strange behaviour I cannot explain with the ' char. I do
the following:
1) there is a string with ' inside.
2) I encode the string with urlencode, I put it in a $_GET['arg']
variable
3) in the next page (pointed by the link that included the arg param),
I do $str=urldecode($_GET['arg'])
... then ' comes out as \' ! (?)
Why? In the url arg contains %27 instead of ' ... The thing happens
*even if* I don't use urldecode :O :|
I think there is some processing done by _GET handling but I can't
find anything about this... Plese help :)
bye
Re: Strange behaviour with " char
am 29.10.2007 12:05:20 von luiheidsgoeroe
On Oct 29, 11:58 am, "Gotch@" wrote:
> [Correction about previous]
>
> Hi. I found a strange behaviour I cannot explain with the ' char. I do
> the following:
>
> 1) there is a string with ' inside.
> 2) I encode the string with urlencode, I put it in a $_GET['arg']
> variable
> 3) in the next page (pointed by the link that included the arg param),
> I do $str=urldecode($_GET['arg'])
>
> .. then ' comes out as \' ! (?)
>
> Why? In the url arg contains %27 instead of ' ... The thing happens
> *even if* I don't use urldecode :O :|
>
> I think there is some processing done by _GET handling but I can't
> find anything about this... Plese help :)
magic_qoutes_gpc, disable it, or it you can't, use this:
$arg = get_magic_quotes_gpc() ? stripslashes($_GET['arg']) :
$_GET['arg'];
Re: Strange behaviour with " char
am 29.10.2007 12:45:21 von Jerry Stuckle
Gotch@ wrote:
> [Correction about previous]
>
> Hi. I found a strange behaviour I cannot explain with the ' char. I do
> the following:
>
> 1) there is a string with ' inside.
> 2) I encode the string with urlencode, I put it in a $_GET['arg']
> variable
> 3) in the next page (pointed by the link that included the arg param),
> I do $str=urldecode($_GET['arg'])
>
> .. then ' comes out as \' ! (?)
>
> Why? In the url arg contains %27 instead of ' ... The thing happens
> *even if* I don't use urldecode :O :|
>
> I think there is some processing done by _GET handling but I can't
> find anything about this... Plese help :)
>
> bye
>
>
Your server has magic_quotes_gpc enabled.
If this is your server, I'd recommend you disable it. If it's a shared
server, you can disable it in the .htaccess file, but quite frankly, I'd
recommend you find a different host.
To get around your immediate problem, you can use stripslashes() to
remove the slashes, and get_magic_quotes_gpc() to see if the flag is on
or off.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Strange behaviour with " char
am 29.10.2007 14:53:10 von darioros
Tnx to everybody... I can't change my host, but stripcslashes is doing
the job just fine.
Bye :)
On 29 Ott, 11:58, "Gotch@" wrote:
> [Correction about previous]
>
> Hi. I found a strange behaviour I cannot explain with the ' char. I do
> the following:
>
> 1) there is a string with ' inside.
> 2) I encode the string with urlencode, I put it in a $_GET['arg']
> variable
> 3) in the next page (pointed by the link that included the arg param),
> I do $str=urldecode($_GET['arg'])
>
> .. then ' comes out as \' ! (?)
>
> Why? In the url arg contains %27 instead of ' ... The thing happens
> *even if* I don't use urldecode :O :|
>
> I think there is some processing done by _GET handling but I can't
> find anything about this... Plese help :)
>
> bye