![]() |
![]() ![]() |
![]() |
-Relaxx- |
![]()
Post
#1
|
Goście ![]() |
Posiadam pewien skrypt tylko powiedzcie mi czemu nie dzaial loguje ale nie wykonuje dalszych fukncji
index.php Kod <?php error_reporting(1); ini_set("max_execution_time", 0); $limit = 30; // jeden proces doda 30 postow require 'curl.class.php'; $user = "LOGIN"; // tu login z epulsa $pass = "PASSW"; // tu haslo z epulsa // tablice potrzebne do poprawnego dzialania skryptu // lepiej ich nie edytowac $epuls = array( "http://www.epuls.pl/", "", "discussion_topics.php?lngGID=", "discussion_write.php?" ); $loginTab = array( "MD5" => md5(strtoupper($user)."|".$pass), "strUserLogin2" => strtoupper($user), "blnLoginFormMD5" => 1, "lngLoginSystemID" =>0 ); $postTab = array( "strText" => "", // tresc posta - mozna zedytowac (ja mialem duzo nizej, generowany losowo) "strSubject" => "Re:", // tytul posta - to mozna zedytowac "sub" => "+Wy%B6lij+" ); // --------------------------------Z curl::$onErrorSleep = 360; // w przypadku wystapienia bledu usypia proces na 360s // logowanie i pobieranie informacji o sesji $html = curl::get($epuls[0]); preg_match('/<frame src="(.*)" id="top" name="top" scroll="0" scrolling="no" noresize><\/frame>/Ui', trim($html), $matches); $epuls[1] = $matches[1]; curl::$referer = $epuls[0].$epuls[1]; $tmp = explode(" ", $epuls[1]); $tmp = explode("&", $tmp[1]); $sesId = $tmp[0]; curl::$postData = $loginTab; curl::get($epuls[0]."messages.php?t_session=".$sesId); curl::$referer = $epuls[0]."messages.php?t_session=".$sesId; // ------------------------ while($limit--) // licznik postow { // pobiera i losuje topici $gid = rand(10, 1000); $html = curl::get($epuls[0].$epuls[2].$gid); preg_match_all('/discussion_posts.php\?lngTID=(.*)>/Ui', trim($html), $matches); for($i=1, $j=count($matches[1]); $i<$j; $i++) if ( is_numeric($matches[1][$i]) ) { $tid = $matches[1][$i]; // w tym miejscu mialem losowanie z tablicy linkow do zapostowania // mozna tutaj wrzucic np. jakis curl_get() strony z przyslowiami, czy newsami // plus jakies linki do swoich stron $postTab["strText"] = "tekst postu :) :) :) :) :) :)"; // postuje curl::$postData = $postTab; curl::$referer = "http://www.epuls.pl/discussion_write.php?lngGID=".$gid."&lngTID=".$tid."&lngPID="; $action = "blnPost=1&lngGID=".$gid."&lngTID=".$tid."&lngPID="; $html = curl::get($epuls[0].$epuls[3].$action); // ----------------- // wyswietla adres posta echo "\n @: ".$epuls[0]."discussion_posts.php?".$action; // usypia na 30s sleep(30); // losowe usypianie, dzieki temu skrypt postuje bardziej chaotycznie for($i=0; $i<rand(1,10); $i++) { $idle = rand(0,10); echo "[$idle]"; sleep($idle); } } } ?> curl.class.php Kod <?php class curl { public static $handle; public static $userAgent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; public static $cookies = 1; public static $cookiesFile = "cookies.txt"; public static $timeOut = 90; public static $retHeader = 1; public static $followLocation = 1; public static $retTransfer = 1; public static $headers = NULL; public static $postData = NULL; public static $referer = NULL; public static $onErrorSleep = NULL; static function get($target) { self::$handle = curl_init($target); curl_setopt( self::$handle, CURLOPT_RETURNTRANSFER, self::$retTransfer ); curl_setopt( self::$handle, CURLOPT_FOLLOWLOCATION, self::$followLocation ); curl_setopt( self::$handle, CURLOPT_TIMEOUT, self::$timeOut ); curl_setopt( self::$handle, CURLOPT_HEADER, self::$retHeader ); curl_setopt( self::$handle, CURLOPT_USERAGENT, self::$userAgent); if ( self::$referer ) { curl_setopt( self::$handle, CURLOPT_REFERER, $referer); } if ( self::$cookies ) { curl_setopt( self::$handle, CURLOPT_COOKIEJAR, self::$cookiesFile); curl_setopt( self::$handle, CURLOPT_COOKIEFILE, self::$cookiesFile); } if ( count(self::$postData) ) { foreach(self::$postData as $var => $val) $request .= "$var=".utf8_encode($val)."&"; $request = substr($request, 0, -1); curl_setopt( self::$handle, CURLOPT_POST, 1 ); curl_setopt( self::$handle, CURLOPT_POSTFIELDS, $request ); self::$postData = NULL; } if ( count(self::$headers) ) { curl_setopt( self::$handle, CURLOPT_HTTPHEADER, self::$headers); } $html = curl_exec(self::$handle); $curl_error = curl_error(self::$handle); if ( $curl_error ) { echo "\n curl error: $curl_error"; sleep($onErrorSleep); } curl_close(self::$handle); return $html; } } ?> oglnie to dzwnie napisany ten curl i nie moge zbytnio sie polapac probowalem go zedytowac tak zeby logowal i wchodzil w jedna z pod stron i jakos mi nie szlo |
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 13:50 |