我正在尝试使用 curl 执行两个操作: 1. 登录管理页面 2. 提交表单(添加用户) 第一个没问题,但第二个显示错误未登录。这是我的代码:
$ch1 = curl_init();
$ch2 = curl_init();
curl_setopt($ch1, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" );
curl_setopt($ch1, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch1, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch1, CURLOPT_URL, "http://admin.example.com/admin");
curl_setopt($ch1, CURLOPT_POST, 1);
curl_setopt($ch1, CURLOPT_POSTFIELDS, "user=admin&pass=password");
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
curl_setopt($ch1, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch2, CURLOPT_URL, "http://admin.example.com/admin/adduser");
curl_setopt($ch2, CURLOPT_POST, 1);
curl_setopt($ch2, CURLOPT_POSTFIELDS, "newu=demo&pass=password");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, 1);
$mh = curl_multi_init();
curl_multi_add_handle($mh, $ch1);
curl_multi_add_handle($mh, $ch2);
// execute all queries …Run Code Online (Sandbox Code Playgroud) 如何在页面加载时使用jquery向下滑动div,其中css设置为display:none?我看到很多解决方案,但如果css设置为display:none,则没有人可以滑动div.最好的方法是在加载时隐藏它并在滑动之后但是当页面加载时div会闪烁(显示).