<?php header('Content-Type: text/html; charset=windows-1251'); /****** массив для добавления окончания к нику *******/ $l = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); while ($i < 5) { $word .= $l[array_rand($l)]; $i++; } /*********** для реги *********/ $name = 'onotole';/// приставка к нику $pwd = 'qwertyololo'; /// пароль /********** страница для парсинга *******/ $a = file_get_contents('http://inbox.chmail.ru/register/'); /****** парсим капчу ******/ preg_match('#<td align=center><img src="(.*)" width=130 height=35 border=0>#', $a, $sec); /****** выводим капчу *********/ $im="<img src='http://inbox.chmail.ru".$sec[1]."'>"; echo '<form id="form1" name="form1" method="post" action=""> <input type="text" name="reg" /> <input type="submit" name="Submit" value="Submit" /> </form> <br /> '.$im.''; $reg=$_POST['reg']; /****** курл сеанс ********/ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://inbox.chmail.ru/register/'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'login='.$name.''.$word.'&domain=chmail.ru&passw1='.$pwd.'&passw2='.$pwd.'&question=Как зовут Вашу собаку&answer=cu4ka&gender=unknown&gmt=16&sec_code='.$reg.'&submit=Зарегистрироваться&day=0&month=0&year=0&agree=1'); $exec = curl_exec($ch); curl_close($ch); $log=$name.$word.";".$pwd; $fp=fopen("good.txt", "a"); fputs($fp, $log."\r\n"); fclose($fp); ?>