Показать сообщение отдельно

  #15536  
Старый 03.04.2010, 01:51
phpdreamer
Постоянный
Регистрация: 26.07.2009
Сообщений: 321
С нами: 8838619

Репутация: 123
По умолчанию

warlok, вот это близко к правде... но думаю, я не заметил еще какую-то проверку( завтра попробую еще поковырять
PHP код:
<?php

#---------------------------------------------------------------------------
function noPost($url)
    {
       
$ch curl_init($url);
       
curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox/3.0.4");
       
curl_setopt($chCURLOPT_COOKIEJAR"./cook");
       
curl_setopt($chCURLOPT_COOKIEFILE"./cook");
       
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
       
curl_setopt($chCURLOPT_RETURNTRANSFER1);
       
$result  curl_exec($ch);
       return 
$result;
    }
function 
post($url,$post,$refer)
    {
       
$ch curl_init($url);
       
curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox/3.0.4");
       
curl_setopt($chCURLOPT_POST1);
       
curl_setopt($chCURLOPT_POSTFIELDS$post);
       
curl_setopt($chCURLOPT_REFERER$refer);
       
curl_setopt($chCURLOPT_COOKIEJAR"./cook");
       
curl_setopt($chCURLOPT_COOKIEFILE"./cook");
       
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
       
curl_setopt($chCURLOPT_RETURNTRANSFER1);
       
$result  curl_exec($ch);
       return 
$result;
    }
#---------------------------------------------------------------------------
    
$first noPost('http://digg.com/register/','','http://digg.com/register/');
preg_match("#/captcha/(.*?).jpg#",$first,$capcha);
//адрес картинки
$Capch 'http://digg.com' $capcha['0'];
//получаем картинку
$img noPost($Capch,'','');
//сохраняем в файл
file_put_contents('captcha.jpg',$img );

#---------------------------------------------------------------------------

if(isset($_POST['captcha']))
{
    echo 
post('http://digg.com/register/',$_POST['captcha'] ,'http://digg.com/register/');
}
else
{
    echo 
'<img src="captcha.jpg"> <br />
    <form id="form1" name="form1" method="post" action="">
    <label>
        <input type="text" name="captcha[input]" id="captcha[input]" />
    </label>
    <input type="hidden" id="captcha[id]" name="captcha[id]" value="'
.$capcha['1'].'" />
    <label>
        <input type="submit" name="button" id="button" value="Отправить" />
    </label>
    </form>'
;
}

?>
Tesson, пробей в гугле "javascript создание окон"
 
Ответить с цитированием