如何在PHP中以模板形式模拟Post?

时间:2016-09-18 18:17:58

标签: php forms curl http-post

Firebug中,我想将产品添加到购物篮中,

我通过{{3}}监控网络,我想通过表单模拟此请求,我试试这个:

    for($i = 0; $i < $count; $i++){
        $codeHtml .= "<form id='monForm' action='http://www.chronodrive.com/home.componentark.productslist.productthumbnail.favoriteandbasket.emptyadditem:send-analytics/LV0000007704/-1/CLASSIC/-1/WEB$007cPUSH_HOME$007c1$002f12745162/Homepage$007cArk$007cadd$0020to$0020cart$002fLV0000007704$002fEau$0020min$00e9rale$0020naturelle' method='post' target='iframe' style='display:none;'>";
        $codeHtml .=    "<input name=\"t:zoneid\"  value='dummy'/>";

        $codeHtml .=    "<input id=\"submit".$i."\" type=\"submit\">";
        $codeHtml .= '</form>'."\n";
    }

更新

我试过 CURL ,因为它没有添加任何文章

UPDATE2

在检查网络时,请求此请求所需的参数是:

t:zoneid=dummy

,网址为:

http://www.chronodrive.com/home.componentark.productslist.productthumbnail.favoriteandbasket.emptyadditem:send-analytics/LV0000007704/-1/CLASSIC/-1/WEB$007cPUSH_HOME$007c1$002f12745162/Homepage$007cArk$007cadd$0020to$0020cart$002fLV0000007704$002fEau$0020min$00e9rale$0020naturelle

没有其他参数

0 个答案:

没有答案