How to get & and %26 trough Url parameters

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Tony_db
Forum Members
Forum Members
Posts: 24
Joined: Mon Nov 12, 2007 8:31 am
Location: Haarlem - Netherlands

How to get & and %26 trough Url parameters

Post 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 ? ???
viebig

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

Post by viebig »

how are you getting those params? regards
Tony_db
Forum Members
Forum Members
Posts: 24
Joined: Mon Nov 12, 2007 8:31 am
Location: Haarlem - Netherlands

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

Post 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);
viebig

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

Post by viebig »

can you post your htaccess?
Tony_db
Forum Members
Forum Members
Posts: 24
Joined: Mon Nov 12, 2007 8:31 am
Location: Haarlem - Netherlands

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

Post 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?
Last edited by Tony_db on Sun May 17, 2009 9:03 am, edited 1 time in total.
Post Reply

Return to “Developers Discussion”