1
即时通讯尝试从JavaScript发送数组到Joomla 3.x的PHP文件。发送数组从javascript到php通过POST在Joomla 3.x
var options = ['foo', 'bar'];
$.post('index.php?option=component&view=componentview&Itemid=123&tmpl=component&layout=xlsx', {'xlsx_options': options})
然后,我有一个php文件,它创建数据以下载xlsx文件。但我需要通过这个选项数组进行筛选,并且我无法检索它。我试过这个没有成功。
$xlsx = $_POST['xlsx_options'];
$xlsx = json_decode($_POST['xlsx_options'], true);
$xlsx = JFactory::getApplication()->input->get('xlsx_options');
任何帮助?谢谢!
请让我知道此解决方案是否适合您。谢谢! – Woodrow