Php 使用类似curl的用户访问url
我有一个购物车,我想要一个curl函数将产品添加到购物车中,它是在用户单击“添加到购物车”链接时添加的,但我尝试了许多curl函数,购物车仍然是空的: 我的代码:Php 使用类似curl的用户访问url,php,curl,Php,Curl,我有一个购物车,我想要一个curl函数将产品添加到购物车中,它是在用户单击“添加到购物车”链接时添加的,但我尝试了许多curl函数,购物车仍然是空的: 我的代码: $url = 'The href of the add to cart button when click on it the product added to the cart'; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($cur
$url = 'The href of the add to cart button when click on it the product added to the cart';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$data = curl_exec($curl);
curl_close($curl);
如果你不提供实际地址,那就很难了。也许您必须在登录后保存cookie,然后使用CURLOPT_cookie