Getting array param out of query string with PHP

点点圈 提交于 2019-12-06 16:02:55

Your query string should rather look like this:

?formparts[]=a&formparts[]=b&formparts[]=c

If you're dealing with a query string, you are looking at the $_GET variable. This will contain everything after the ? in your previous question.

So what you will have to do is pretty much the opposite of the other question.

$products = array();
// ... Add some checking of $_GET to make sure it is sane
....
// then assign..
$products = explode(',', $_GET['pname']);

and so on for each variable. I must give you a full warning here, you MUST check what comes through the $_GET variable to make sure it is sane. Otherwise you risk having your site compromised.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!