Quote from: OpenGeek at Jul 09, 2006, 10:39 PM
If you mean the parameter string from the client request, you get that with $_REQUEST or $_GET or $_POST as appropriate. If you mean the snippet parameter string, each will be set as a variable with the key as the name, within the scope of the snippet. Your var names would simply be $key_1, $key_2, ...
$_REQUEST is a good idea, but it returns strange results:
document code:
[!snippet?&id=`DisplayName`¶m=`%26$name%3DVorspiel`!]
code in snippet
$x = "";
foreach ($_REQUEST as $key=>$value)
$x .= $key . ' ' . $value . '<br>';
return $id . " : " . $x;
leads to the output:
DisplayName : SN44a7f555155cd 9325a6fbbf1ca14da11bfcd4e364d419
webfxtab_resourcesPane 3
A you can see above I found a way around - to put all parameters in one variable called $param. Therefore you have to mask & as %26 and = as %2D.
Now I parse the $param and return an array
function formatURLParameterToArray($paramListe)
{if (!isset($paramListe) || strlen($paramListe)<1)
return null;
$paramListe = urldecode($paramListe);
$paramArray = array();
# erstes & entfernen
if (strpos($paramListe,'&')==0)
$paramListe = substr($paramListe,1);
$a = explode('&', $paramListe);
$i = 0;
while ($i < count($a))
{ $b = split('=', $a[$i]);
$paramArray[htmlspecialchars(urldecode($b[0]))] =
htmlspecialchars(urldecode($b[1]));
$i++;
}
return $paramArray;
}
This works, but you have to mask the & and = - that is not really a readable code.
$_REQUEST would be much better