Php 将Curl对象传递到下一页

Php 将Curl对象传递到下一页,php,curl,Php,Curl,我正在使用curl请求 我的代码 $url = "http://www.somesite.com/members/"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERPWD, "myusername:mypassword"); $output = curl_exec($ch); 我想

我正在使用curl请求

我的代码

$url = "http://www.somesite.com/members/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "myusername:mypassword");
$output = curl_exec($ch);
我想将curl对象“$ch”传递到下一页。 我试过使用会话和cookie。但什么也没发生


我将如何做到这一点?请帮我解决这个问题

您不能在会话中存储资源:它们是没有固定逻辑的内存数据结构。Per:

某些类型的数据无法序列化,因此存储在会话中。它包括具有循环引用的资源变量或对象(即将自身引用传递给另一个对象的对象)

您可以:

  • 将URL传递到下一页并再次执行下载,或
  • 将输出传递到下一页并进行处理