Page 1 of 1

How to get & and %26 trough Url parameters

Posted: Fri May 15, 2009 5:22 pm
by Tony_db
I cant pass strings by URL paramaters like

shops\Henson&Hedges
or
shops\Henson%26Hedges     (when urlencode() used)

The parameters are both cut of after "Henson"

Is there a way to get the paramaters trough the CMS ? ???

Re: How to get & and %26 trough Url parameters

Posted: Fri May 15, 2009 9:38 pm
by viebig
how are you getting those params? regards

Re: How to get & and %26 trough Url parameters

Posted: Sat May 16, 2009 7:14 am
by Tony_db
The URL above gets rewirtten in .htaccess to the following:

page=winkels&mact=winkels,cntnt01,default,0&cntnt01winkelnaam=Henson&Hedges
or
page=winkels&mact=winkels,cntnt01,default,0&cntnt01winkelnaam=Henson%26Hedges

I just call it it my module with:

$params['winkelnaam'];
print_r($params);

Re: How to get & and %26 trough Url parameters

Posted: Sat May 16, 2009 5:39 pm
by viebig
can you post your htaccess?

Re: How to get & and %26 trough Url parameters

Posted: Sun May 17, 2009 9:01 am
by Tony_db
hmmm, i dont see why.

After this htaccess doesnt doe anything, and it still goos wrong.

page=winkels&mact=winkels,cntnt01,default,0&cntnt01winkelnaam=Henson%26Hedges

I just cant get the wroth var from 'winkelnaam'

But i fixed it in a other way, i forse a special pretty URL string, without any special characters.

Code: Select all

<?php

function ParseToPrettyString($string)
{
	// filteren speciale letters
	$string = strtr($string,"ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ","SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
	// filteren url encodings
	$string = preg_replace('#\b\%\d.(|\b)#u', '', $string);
	// url encode op andere specialae tekens
	$string = urlencode($string);
	// filteren url encodings en veranderen in +
	$string = preg_replace('#\b\%\d.(|\b)#u', '+', $string);
	// filteren op meer opeenvolgende +
	$string = preg_replace('#\b\+\++(|\b)#u', '+', $string);
	
	return $string;
}

?>

PS: Anybody knows what wysiwyg editor here is used?