Do you want to do something about curl? ? php$url = ” http://bbs.lampbrother.net/login.php”; $ur
Curl simulates landing problems
This post was last edited by Zkg510168343 on 2013-10-22 15:29:21
$url = “http://bbs.lampbrother.net/login.php”;
$urls = “http://bbs.lampbrother.net”;
$lgt = 0;
$user = “zkg12345”;
$pass = “123456”;
$question = 0;
$hideid = 1;
$temp = tempnam(‘./tep’, ‘cookie’);
$postdata = “forward=&jumpurl=”.$urls.”&step=2&lgt=”.$lgt.”&pwuser=”.$user.”&pwpwd=”.$pass.”&question=”.$question.”&answer=&hideid=” .$hideid.”&cktime=”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_COOKIEJAR, $temp);
$data = curl_exec($ch);
curl_close($ch);
//echo $data; // You can see that the login is successful and the jump is in progress
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘http://bbs.lampbrother.net/index.php’);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $temp);
curl_exec($ch);
curl_close($ch);
? >
After the login, I found that the login was successful when I printed it, and it showed that the page was jumping, but I asked again that the home page was still not logged in, and other pages were also not logged in. May I ask what is the problem and how to debug it
A coo810b.tmp file is generated in the cookie temp file
A value of
# Netscape HTTP Cookie File
#
Curlm. Haxx. Se/RFC/cookie_…
# This file was generated by libcurl! Edit at your own risk.
.lampbrother.net TRUE / FALSE 1413961648 4f62d_c_stamp 1382425648
.lampbrother.net TRUE / FALSE 1350889647 4f62d_lastvisit deleted
.lampbrother.net TRUE / FALSE 1413961648 4f62d_lastpos other
.lampbrother.net TRUE / FALSE 1350889647 4f62d_ci deleted
.lampbrother.net TRUE / FALSE 1413961648 4f62d_ck_info %2F%09.lampbrother.net
.lampbrother.net TRUE / FALSE 1350889647 4f62d_regactivate deleted
To:
This post was last edited by Zkg510168343 on 2013-10-22 15:29:21
$url = “http://bbs.lampbrother.net/login.php”;
$urls = “http://bbs.lampbrother.net”;
$lgt = 0;
$user = “zkg12345”;
$pass = “123456”;
$question = 0;
$hideid = 1;
$temp = tempnam(‘./tep’, ‘cookie’);
$postdata = “forward=&jumpurl=”.$urls.”&step=2&lgt=”.$lgt.”&pwuser=”.$user.”&pwpwd=”.$pass.”&question=”.$question.”&answer=&hideid=” .$hideid.”&cktime=”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_COOKIEJAR, $temp);
$data = curl_exec($ch);
curl_close($ch);
//echo $data; // You can see that the login is successful and the jump is in progress
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘http://bbs.lampbrother.net/index.php’);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $temp);
curl_exec($ch);
curl_close($ch);
? >
After the login, I found that the login was successful when I printed it, and it showed that the page was jumping, but I asked again that the home page was still not logged in, and other pages were also not logged in. May I ask what is the problem and how to debug it
A coo810b.tmp file is generated in the cookie temp file
A value of
# Netscape HTTP Cookie File
#
Curlm. Haxx. Se/RFC/cookie_…
# This file was generated by libcurl! Edit at your own risk.
.lampbrother.net TRUE / FALSE 1413961648 4f62d_c_stamp 1382425648
.lampbrother.net TRUE / FALSE 1350889647 4f62d_lastvisit deleted
.lampbrother.net TRUE / FALSE 1413961648 4f62d_lastpos other
.lampbrother.net TRUE / FALSE 1350889647 4f62d_ci deleted
.lampbrother.net TRUE / FALSE 1413961648 4f62d_ck_info %2F%09.lampbrother.net
.lampbrother.net TRUE / FALSE 1350889647 4f62d_regactivate deleted
To:
—— Solution ——————–
Full path!
$temp = realpath(tempnam(‘./tep’, ‘cookie’));