Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("content-type: text/html; charset=utf-8");
- /*
- vBulletin Poster Class
- vBulletin forumlara login olup konu açar.
- Ahmet Burak DEMIRKOPARAN tarafından kodlanmıştır.
- */
- set_time_limit(0);
- class vb{
- public $loginpostpath = "login.php?do=login";
- public $konuacform = "newthread.php?do=newthread&f=";
- /*
- Gidip forumda yeni konu butonuna tıkladığınızda linkte bir sayı verir kategori id sidir.
- o Sayıyıda eşittirden sonra ekleyeceğiz.
- http://www.frmtr.com/newthread.php?do=newthread&f=41 -> 41 asp,php,perl,html kategorisinin idsidir.
- */
- public function login($siteadi,$kullaniciadi,$sifre){
- $tokenbul = file_get_contents($siteadi."index.php");
- preg_match('/<input type="hidden" name="securitytoken" value="(.*?)"/',$tokenbul,$a);
- $md5sifre = md5($sifre);
- $loginpostbilgileri = array(
- "cookieuser" => "1",
- "do" => "login",
- "s" => "",
- "securitytoken" => $a[1],
- "vb_login_md5password" => $md5sifre,
- "vb_login_md5password_utf" => $md5sifre,
- "vb_login_password" => "",
- "vb_login_username" => $kullaniciadi);
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,$siteadi.$this->loginpostpath);
- curl_setopt($ch,CURLOPT_REFERER,$siteadi."index.php");
- curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 5.1; rv:10.0) Gecko/20100101 Firefox/10.0");
- curl_setopt($ch,CURLOPT_POST,1);
- curl_setopt($ch,CURLOPT_POSTFIELDS,$loginpostbilgileri);
- curl_setopt($ch,CURLOPT_COOKIEJAR,dirname(__FILE__)."/cerez.txt");
- curl_setopt($ch,CURLOPT_COOKIEFILE,dirname(__FILE__)."/cerez.txt");
- curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
- $a = curl_exec($ch);
- curl_setopt($ch, CURLOPT_URL, $siteadi."index.php");
- $a = curl_exec($ch);
- curl_close($ch);
- return iconv("ISO-8859-9","UTF-8",$a);
- }
- public function konuac($siteadi,$kategori_id,$baslik,$mesaj){
- $ot = curl_init();
- curl_setopt($ot,CURLOPT_URL,$siteadi.$this->konuacform.$kategori_id);
- curl_setopt($ot,CURLOPT_COOKIEFILE,dirname(__FILE__)."/cerez.txt");
- curl_setopt($ot,CURLOPT_RETURNTRANSFER,true);
- $exec = curl_exec($ot);
- preg_match('/<input type="hidden" name="securitytoken" value="(.*?)"/',$exec,$securitytoken);
- $konuacpostbilgileri = array(
- "do" => "postthread",
- "emailupdate" => "9999",
- "f" => $kategori_id,
- "iconid" => "0",
- "loggedinuser" => "3652239",
- "message" => $mesaj,
- "parseurl" => "1",
- "posthash" => "",
- "poststarttime" =>"",
- "s" => "",
- "sbutton" => "Yeni Konuyu Gönder",
- "securitytoken" => $securitytoken[1],
- "subject" => $baslik,
- "taglist" => "",
- "wysiwyg" => "1"
- );
- curl_setopt($ot,CURLOPT_POST,1);
- curl_setopt($ot,CURLOPT_POSTFIELDS,$konuacpostbilgileri);
- curl_setopt($ot,CURLOPT_FOLLOWLOCATION,true);
- $exec = curl_exec($ot);
- curl_opt($ot,CURLOPT_URL,$siteadi."index.php");
- return $exec = curl_exec($ot);
- curl_close($ot);
- }
- }
- $sinif = new vb();
- $sinif->login("http://frmtr.com/","morukh2","alaturkaces");
- $sinif->konuac("http://www.frmtr.com/","41","deneme2","curl ile post deneme");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment