Page 1 of 1

Strange value in parameter

Posted: Mon Aug 17, 2009 3:56 pm
by jan.zitniak
Hello.

I have problem in parameters. In real server the parameter includes added value 25, see following:

In my localhost everything is ok when I put values into form inputs I get in browser following url:
http://localhost/lacneubytovanie.sk/ind ... ajsk%C3%A1

but on my real server I get:
http://www.lacneubytovanie.sk/index.php ... %25C3%25A1
(then result is bad)
should be:
http://www.lacneubytovanie.sk/index.php ... ajsk%C3%A1
(then result is ok)

the difference is value 25 added into parameter from and to as well. Can you give me advance what kind of problem it is?

Jan :)

Re: Strange value in parameter

Posted: Mon Aug 17, 2009 5:05 pm
by requinix
Looks like the text for the URL is being run through urlencode twice. Should only be once.

Code: Select all

function filtertext($text) {
    $text = preg_replace("/a dog/", "a cat", $text);
    $text = utf8_encode($text);
    $text = urlencode($text);
    return $text;
}
 
echo urlencode(filtertext("banská"));

Re: Strange value in parameter

Posted: Mon Aug 17, 2009 5:23 pm
by jan.zitniak
2tasairis: Thanks for advice, it helped me.