Need help with simple PHP plugin I'm not a plugin developer, nor is my knowledge of PHP sufficient to handle this issue.

I need a simple method or plugin, to be able to generate this PHP code in a template.

&lt;?
$params="";

foreach($_POST as $name=&gt;$value)
{
    if ($name!="controllerPage")
    {
        $params=$params.$name."=".$value."&amp;";
    }
}
?&gt;


In the same template I need this code to retrieve the above

&lt;? echo $params; ?&gt; 


Who can show me the way?

This is the POST data that is attached to the URL

$_POST=array (
'view' =&gt; 'SearchResult',
'controllerPage' =&gt; 'https://navigantes.eu/yachts-search',
'customCssPath' =&gt; 'https://navigantes.eu/css/booking-manager-small.css',
'setlang' =&gt; 'en',
'target' =&gt; '_blank',
'companyid' =&gt; '1234',
'filter_country' =&gt; 'HR',
'filter_region' =&gt; '',
'filter_base' =&gt; '',
'filter_year' =&gt; '2016',
'filter_month' =&gt; '11',
'filter_date' =&gt; '10',
'filter_duration' =&gt; '7',
'filter_flexibility' =&gt; 'on_day',
)


Which needs to be translated to this:

view=SearchResult&amp;amp;customCssPath=https://navigantes.eu/css/booking-manager-small.css&amp;amp;setlang=en&amp;amp;target=_blank&amp;amp;companyid=1234&amp;amp;filter_country=HR&amp;amp;filter_region=&amp;amp;filter_base=&amp;amp;filter_year=2016&amp;amp;filter_month=11&amp;amp;filter_date=10&amp;amp;filter_duration=7&amp;amp;filter_flexibility=on_day&amp;


Solved the issue by using {{ craft.request.getPost('') }} method:

            &lt;iframe name="" width="100%" height="800" frameborder="0" scrolling="auto"
            src="https://www.booking-manager.com/wbm2/page.html?
                view={{ craft.request.getPost( 'view' ) }}&amp;
                customCssPath={{ craft.config.environmentVariables.rootUrl }}/css/booking-manager-small.css&amp;
                setlang={{ craft.request.getPost( 'setlang' ) }}&amp;
                companyid={{ craft.request.getPost( 'companyid' ) }}&amp;
                filter_country={{ craft.request.getPost( 'filter_country' ) }}&amp;
                filter_region={{ craft.request.getPost( 'filter_region' ) }}&amp;
                filter_base={{ craft.request.getPost( 'filter_base' ) }}&amp;
                filter_year={{ craft.request.getPost( 'filter_year' ) }}&amp;
                filter_month={{ craft.request.getPost( 'filter_month' ) }}&amp;
                filter_date={{ craft.request.getPost( 'filter_date' ) }}&amp;
                filter_duration={{ craft.request.getPost( 'filter_duration' ) }}&amp;
                filter_flexibility={{ craft.request.getPost( 'filter_flexibility' ) }}&amp;
            "&gt;
        &lt;/iframe&gt;


And finally Brad's suggested method worked by changing craft.request.getSegments() into craft.request.getPost():

{% set segments = craft.request.getPost() %}
{% set stringParams = '' %}

{% for name, segment in segments %}
{% if name != 'controllerPage' %}
    {% set stringParams = stringParams ~ name ~ '=' ~ segment ~ '&amp;' %}
{% endif %}
{% endfor %}

&lt;iframe name="" width="100%" height="800" frameborder="0" scrolling="auto" src="https://www.booking-manager.com/wbm2/page.html?{{ stringParams }}"&gt;
I think you can do this in the template by using for example:

craft.request.getSegments


or

craft.request.getParam( name )


See the docs:

https://craftcms.com/docs/templating/craft.request