Strange value in parameter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jan.zitniak
Forum Newbie
Posts: 3
Joined: Mon Aug 17, 2009 3:48 pm

Strange value in parameter

Post 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 :)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Strange value in parameter

Post 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á"));
jan.zitniak
Forum Newbie
Posts: 3
Joined: Mon Aug 17, 2009 3:48 pm

Re: Strange value in parameter

Post by jan.zitniak »

2tasairis: Thanks for advice, it helped me.
Post Reply