Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

Unable to get url param 13.10.2012 19:27

In fields and code section, in php code, I try to get url param, but it doesn't seems to work.
For example : $_SERVER['REQUEST_URI'] doesn't show param, and $_GET['Itemid']) show the ID of my homepage (instead of the ID of the page where my form is).
How can we get params from url within this php code section ?
NB : url of the page where form is published is index.php?option=com_community&view=groups&task=viewgroup&groupid=24&Itemid=581&lang=fr and I would like to get "groupid" param.

Edited by moon_740 - 13.10.2012 23:44

Re: Unable to get url param 14.10.2012 10:58

Hello,

PHP code is executed when Calculate button is cliked, and it uses ajax calls to get results.

So, to get the url where module is loaded you should use in PHP Code:

$url=$_SERVER['HTTP_REFERER'];

This gives you the complete url. If you want to get one parm you may use this code:

$url=$_SERVER['HTTP_REFERER'];
$url_query=parse_url($url,PHP_URL_QUERY);
parse_str($url_query,$url_array);
$myparam=$url_array['groupid'];

and now in $myparam you will see the groipid from the referer url.

Hope this help. Regards,
Moonsoft Team
www.moonsoft.es

Re: Unable to get url param 14.10.2012 19:18

It works, nice. Thanks a lot.
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Our clients' feedback