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

  #9  
Старый 27.08.2009, 14:57
geforse
Постоянный
Регистрация: 02.03.2008
Сообщений: 893
Провел на форуме:
5365841

Репутация: 712


Отправить сообщение для geforse с помощью ICQ
Smile

С кодировкой сам разберись, $result = iconv("Windows-1251","UTF-8",$result); у меня что-то не корректно отображается

Действительно, тут немного другая чем на почте...
PHP код:
<?php
@set_time_limit(0);
//-----------------//
$zapros 'http://yandex.ru/yandsearch?text=antichat&stpar2=%2Fh1%2Ftm4%2Fs2&stpar4=%2Fs2&stpar1=%2Fu0';
//-----------------//

       
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;
    }
    
  if(
$_POST['captcha'])
    {
       
$result post('http://captcha.yandex.net/send.xml','key='.$_POST['key'].'&retpath='.$zapros.'%26stpar4%3D%252F+s1&rep='.trim($_POST['captcha']),$zapros);
       if(
preg_match('#>Вы (.*?) у#i',$result,$end))
        {
          echo 
'<script>alert(\'Не правильный код!\')</script>';
          echo 
'<meta http-equiv="Refresh" content="0; url=index.php">';
        }
        else
        {
        echo 
$result;
        }
    }
    else
    {
    
$result post('http://captcha.yandex.net/',null,'http://yandex.ru/');
    
preg_match('#y" value="(.*?)"#i',$result,$key);
    
        echo 
'<img class="captcha-img" name="captcha" src="http://captcha.yandex.net/image?key='.$key[1].'" alt=""><br>
          <form name="captcha_form" action="index.php" method="POST">
          <input type="text" name="captcha" value="" /><br>
          <input type="hidden" name="key" value="'
.$key[1].'" />
             <input type="submit" value="ok">
           </form>'

    }
/* geforse.name */
?>
 
Ответить с цитированием