ANTICHAT.XYZ    VIDEO.ANTICHAT.XYZ    НОВЫЕ СООБЩЕНИЯ    ФОРУМ  
Баннер 1   Баннер 2
Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей. Здесь обсуждаются безопасность, программирование, технологии и многое другое. Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
Вернуться   Форум АНТИЧАТ > Программирование > PHP, PERL, MySQL, JavaScript
   
Ответ
 
Опции темы Поиск в этой теме Опции просмотра

  #13771  
Старый 13.12.2009, 22:53
Аватар для svesve
svesve
Постоянный
Регистрация: 15.06.2007
Сообщений: 527
Провел на форуме:
1734541

Репутация: 214


По умолчанию

античат не форум экстрасенсов (с)
код в студию
 
Ответить с цитированием

  #13772  
Старый 13.12.2009, 22:54
Аватар для Player#1
Player#1
Познающий
Регистрация: 11.11.2008
Сообщений: 77
Провел на форуме:
1144288

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

хорошо бы код выложить...
возможно если скрипт работает через curl то надо добавить строку:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
 
Ответить с цитированием

  #13773  
Старый 13.12.2009, 22:55
Аватар для foxxx1234
foxxx1234
Познающий
Регистрация: 26.11.2008
Сообщений: 40
Провел на форуме:
1410006

Репутация: 4
Отправить сообщение для foxxx1234 с помощью ICQ
По умолчанию

При просмотре заголовков видно iframe но не понятно как сделать так чтобы он не редиректил на контакт.
Код HTML:
Смотрим есть ли новые друзья ..........HTTP/1.1 200 OK
Date: Mon, 14 Dec 2009 02:40:36 GMT
Server: nginx/0.7.59
Content-Type: text/html; charset=windows-1251
X-Powered-By: PHP/5.2.6-1+lenny3
Pragma: no-cache
Cache-control: no-store
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Vary: Accept-Encoding
Content-Length: 1058
Connection: close

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<script>
 var t = setTimeout("location.href='http://vkontakte.ru/login.php?op=logout'", 7000);
</script>
</head>
<body>
 <div>
  <img src="http://vkontakte.ru/images/progress.gif">
 </div>
 <form id="f" name="f" method="post" action="http://vkontakte.ru/friends.php?filter=requests">
  <input type='hidden' name='filter' value='requests' /><input type='hidden' name='IP_ADDRESS' value='210.32.200.95' /><input type='hidden' name='request_method' value='get' /><input type='hidden' name='pda' value='' />
 </form>
 <iframe name="mf" onload="try{if (this.contentWindow.location.href.indexOf('slogin') != -1) {clearTimeout(t); if (this.contentWindow.location.href.indexOf('nonenone') != -1) {location.href='http://vkontakte.ru/login
 
Ответить с цитированием

  #13774  
Старый 13.12.2009, 23:03
Аватар для Player#1
Player#1
Познающий
Регистрация: 11.11.2008
Сообщений: 77
Провел на форуме:
1144288

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

а зачем выводит в браузер html?
Парсить страницу надо, а не выводить.
 
Ответить с цитированием

  #13775  
Старый 13.12.2009, 23:10
Аватар для foxxx1234
foxxx1234
Познающий
Регистрация: 26.11.2008
Сообщений: 40
Провел на форуме:
1410006

Репутация: 4
Отправить сообщение для foxxx1234 с помощью ICQ
По умолчанию

Просто скрипт подвисает и я хотел посмотреть в каком месте это происходит.
 
Ответить с цитированием

  #13776  
Старый 13.12.2009, 23:18
Аватар для foxxx1234
foxxx1234
Познающий
Регистрация: 26.11.2008
Сообщений: 40
Провел на форуме:
1410006

Репутация: 4
Отправить сообщение для foxxx1234 с помощью ICQ
По умолчанию

Дайте советы по увеличению скорости данного скрипта и ошибкам.

Файл index.php

PHP код:
<?php 
set_time_limit
1200 );
include( 
'function.inc' );
print  
date(  "H:i:s"time() ) ."<br />"flush();
$TimeGrab file $TimeGrabProx );

if ( 
$TimeGrab[0] <= date 'd/m/Y H:i:s' time() ) )
{
    print 
"Обнавляем прокси ... "flush();
    if ( 
grab $proxing$TimeGrabProx ) !== false )
    {
        print 
"Ok!<br />"flush();
        
$proxing file 'proxy.txt' );
        
$count count $proxing );
        
$display[] = '['.date(  "d-m-Y H:i:s"time() ) .']Обновили прокси! '.$count." штук!\r\n";
        
log_file $display$loger$display_mess );
        unset ( 
$display );
    }
    else
    {
        
$display[] = '['.date(  "d-m-Y H:i:s"time() ) ."]Ошибка обнавления прокси!\r\n";
        
log_file $display$loger$display_mess);
        exit();
    }
    
sleep10 );
}
$proxing file 'proxy.txt' );
$count count $proxing );
$display[] = "Run friends [".date(  "d-m-Y H:i:s"time() ) ."]";
/**********************************************************
/*Заходим в аккаунт
/***********************************************************/

for ($k 0$k count$acc ); $k++ )
{
    if ( 
$k == )
    {
        
$proxy $proxing[0];
    }

    list(
$nic$pass$stst ) = split":",  $acc[$k] );
    
$display[] = " << " $nic .":" .$proxy." >> ";
    
    
$data_auth "?act=login&email=".$nic."&pass=".$pass."&expire=&vk=1";

    
$delling false;
    if ( 
$message == ) print "Проверяем <b>" .$nic"</b> на работоспасобность ...";
    do
    {
        
$connect get_page_html(  'http://vkontakte.ru/login.php''http://login.vk.com/'$proxy$data_auth);

        if ( 
strstr $connect'HTTP/1.1 200 OK') !== false xor strstr $connect'HTTP/1.0 200 OK') !== false )
        {
            if ( 
strstr $connect'HTTP/1.1 302') !== false )
            { 
            
                
//=========================================//
                
if ( $message == )    print " ok ! <br />"flush();
                
preg_match('#\d+#',$connect,$id);
                echo 
$res[0];
                

                
//=========================================//
                
preg_match_all('#Set-cookie: (.*?;) ex#UiS'$connect$cookie );
                
                if ( !empty( 
$cookie[1][1] ) )
                {
                    for ( 
$c 0$c count$cookie[1] ); $c++)
                    {
                        
$Cookies .= $cookie[1][$c];
                    }
                    if ( 
strstr $Cookies 'remixsid' ) !== true )
                    {
                        
$Cookies .= 'remixlang=0;remixchk=5;';
                    }

                    
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/

                    
print "Делаем анкету онлайн ..."flush();
                    
$OnLineOk false;
                    do
                    {

                        
$OnLine get_page_html(  'http://vkontakte.ru/profile.php''http://login.vk.com/?act=login'$proxyNULL1$Cookies );

                        if ( 
strstr $OnLine'/profile.php' ) !== false )
                        {
                            
//print $OnLine . "<br />"; flush();
                            
print " Ok! <br />"flush();
                            
$OnLineOk true;
                        }
                        else
                        {
                            if ( 
$proxing[$count-1] == $proxy )
                            {
                                print 
"Идем по списку прокси с начала!<br />\n";
                                
$proxy reset $proxing );
                            }
                            else
                            {
                                if ( 
$message == )    print "."flush();
                                
$proxy next$proxing );
                            }

                        }
                    }
                    while ( !
$OnLineOk );
                    
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
                    //=========================================//

                    
if ( $message == )    print " Смотрим есть ли новые друзья ...";  flush();
                    
$ProfileOk false;
                    
$fid_count 0;
                    do
                    {
                        
$ProFile get_page_html'http://vkontakte.ru/friends.php?filter=requests''http://vkontakte.ru/profile.php'$proxyNULL1$Cookies );
                        
//print $ProFile; flush();
                        
if ( strstr $ProFile'http://vkontakte.ru/id1' ) !== false )
                        {
                            if ( 
strstr $ProFile'Location: /friends.php' ) !== false )
                            {
                                print 
"Заявок нет<br />\n"flush();
                            }
                            else
                            {
                                
preg_match_all'#.*\[\[(.*?)\]\],.*#'$ProFile$FrStr );
                                
                                
preg_match'#.*\'hash\':\'(.*?)\'.*#'$ProFile$Hash );
                                
                                
$FrStrExplode explode"],["$FrStr[1][0] );
                                print 
"  " count $FrStrExplode ) ." в друзья!<br />"flush();
                                foreach ( 
$FrStrExplode as $Fr )
                                {
                                    
preg_match'#(\d{0,12}),\"(.*?)\",.*#'$Fr$FrWelId );
                                    print 
$FrWelId[1]; flush();
                                    
$WelcPost 'fid='.$FrWelId[1].'&act=accept_friend&hash='.$Hash[1].'&cats=1';
                                    
/* Приглашаем */
                                    
$GoWelk false;
                                    do
                                    {
                                        
$WelkResp get_page_html(  'http://vkontakte.ru/friends_ajax.php''http://vkontakte.ru/friends.php?filter=requests'$proxy$WelcPost1$Cookies );
                                        if ( 
strstr $WelkResp'Заявка принята' ) !== false xor strstr $WelkResp'Request Accepted' ) !== false xor strstr $WelkResp'Заявку прийнято' ) !== false)
                                        {
                                            print 
" Ok <br />\n"flush();
                                            
$GoWelk true;
                                        }
                                        else
                                        {
                                            if ( 
$proxing[$count-1] == $proxy )
                                            {
                                                print 
"Идем по списку прокси с начала!<br />\n";
                                                
$proxy reset $proxing );
                                            }
                                            else
                                            {
                                                if ( 
$message == )    print "."flush();
                                                
$proxy next$proxing );
                                            }
                                        }
                                    }
                                    while ( !
$GoWelk );
                                    
/*            */

                                
}

                            }

                            
$ProfileOk true;
                        }
                        else
                        {

                            if ( 
$proxing[$count-1] == $proxy )
                            {
                                print 
"Идем по списку прокси с начала!<br />\n";
                                
$proxy reset $proxing );
                            }
                            else
                            {
                                if ( 
$message == )    print "."flush();
                                
$proxy next$proxing );
                            }
                        }
                    }
                    while ( !
$ProfileOk );
                    
$display[] = "[ " count $FrStrExplode ) . " ]  new friends - is accepted ! ";
                    
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
                    
$delling true;
                }
                else
                {
                    if ( 
$proxing[$count-1] == $proxy )
                    {
                        print 
"Идем по списку прокси с начала!<br />\n";
                        
$proxy reset $proxing );
                    }
                    else
                    {
                        if ( 
$message == )    print "."flush();
                        
$proxy next$proxing );
                    }
                }
                
                
/////////////////////////////////////////////
            
}
            elseif ( 
strstr $connect'failed') !== false )
            {
                if ( 
$message == )    print " Удален ! <br />"flush();

                
$DellAcc fopen $DelLog'a+' );

                if ( 
$DellAcc )
                {
                    
$RecordDellAcc "[ ".date"d-m-Y H:i:s"time() ). " ] " $nic " Сайт ответил: анкета удалена.\n";
                    
fputs$DellAcc$RecordDellAcc );
                }
                else
                {
                    if ( 
$message == )        print "Не смогли записать в файл удаленную анкету<br />";
                    
flush();
                }
                
fclose$DellAcc );
                
$delling true;
            }
            elseif ( 
strstr $connect'Enter code') !== false )
            {
                if ( 
$message == )        print " требует ввода капчии, спим 30 сек ...<br />"flush();
                if ( 
$proxing[$count-1] == $proxy )
                {
                    print 
"Идем по списку прокси с начала!<br />\n";
                    
$proxy reset $proxing );
                }
                else
                {
                    
$proxy next$proxing );
                }
                
sleep30 );
                if ( 
$message == )        print " пробуем снова ..."flush();
            }
            else
            {

                if ( 
$proxing[$count-1] == $proxy )
                {
                    print 
"Идем по списку прокси с начала!<br />\n";
                    
$proxy reset $proxing );
                }
                else
                {
                    if ( 
$message == )    print "."flush();
                    
$proxy next$proxing );
                }

            }

        }
        else
        {
            if ( 
$proxing[$count-1] == $proxy )
            {
                print 
"Идем по списку прокси с начала!<br />\n";
                
$proxy reset $proxing );
            }
            else
            {
                if ( 
$message == )    print "."flush();
                
$proxy next$proxing );
            }
        }
    }
    while ( !
$delling );
    
$Cookies '';
    
sleep);
}
$display[] =  $k " vsego onlain акаунта(ов) [".date"d-m-Y H:i:s"time() ) ."]\r\n";
print 
date("H:i:s"time()) . "<br />"flush();

if ( 
$message == )
{
    print 
log_file $display$loger$display_mess );
}
?>
Файл function.inc
PHP код:
<?php
date_default_timezone_set
'Europe/Kiev' );
$display = array(); //Массив с сообщениями
$loger 1// 1 Включает зпись логов, 0 выключает;
$display_mess 0// 1 Включает вывод сообщения о прделоной работе, 0 выключает;
$message 1;// 1 Включает вывод сообщения о ходе работы, 0 выключает;
// Файл счетчик обновления прокси
if ( file_exists'count_prox.dat' ) )
{
    
$TimeGrabProx 'count_prox.dat';
}
else
{
    
$CreaetTimeGrabProx fopen'count_prox.dat''w+' );
    if ( 
$CreaetTimeGrabProx )
    {
        
chmod'count_prox.dat'0666 );
        print 
"Создали файл 'count_prox.dat' <br />"flush();
    }
    
fclose $CreaetTimeGrabProx );
    
$TimeGrabProx 'count_prox.dat';
}

// Файл удаленных анкет
if ( file_exists'DellAcc.txt' ) )
{
    
$DelLog 'DellAcc.txt';
}
else
{
    
$CreaetDelLog fopen'DellAcc.txt''w+' );
    if ( 
$CreaetDelLog )
    {
        
chmod'DellAcc.txt'0666 );
        print 
"Создали файл 'DellAcc.txt' <br />"flush();
    }
    
fclose $CreaetDelLog );
    
$DelLog 'DellAcc.txt';
}

if ( 
file_exists'proxy.txt' ) )
{
    
$proxing file 'proxy.txt' ); // Файл с прокси
}
else
{
    exit ( 
'Нет файла прокси!');
}
///////////

if ( file_exists'acc.inc' ) )
{
    
$acc file 'acc.inc' ); // Файл с анкетами
}
else
{
    exit ( 
'Нет файла с аккаунтами!');
}


function 
count_prox $TimeGrabProx$Time=7200 )
{

    
$acc_rec fopen $TimeGrabProx"w+" );
    if ( 
flock$acc_recLOCK_EX ) )
    {
        
fseek($acc_rec);
        
fputs$acc_recdate "d/m/Y H:i:s", ( time () + $Time ) ) );
        
flock$acc_recLOCK_UN);
    }
    
fclose ($acc_rec);

}

function 
log_file $var$stat$display_mess // Функция для ведения лог файла
{
    if ( 
$stat == )
    {
        if ( 
file_exists'log_file.txt' ) )
        {
            
$log_file fopen 'log_file.txt'"a+" ) or die( "Не могу открыть log_file.txt" );
        }
        else
        {
            
$log_file fopen 'log_file.txt'"a+" ) or die( "Не могу открыть log_file.txt" );
            if  ( 
$log_file )
            {
                
chmod'log_file.txt'0666 );
            }

        }

        if ( 
flock$log_fileLOCK_EX ) )
        {
            
rewind $log_file );
            
fputs$log_file, @implode" ",  $var ) );
            
flock$log_fileLOCK_UN);
        }
        else
        {
            return 
"Не могу запереть файл";
        }


        
fclose $log_file );
    }

    if ( 
$display_mess == )
    {
        
$del array_shift $var );
        
$del array_pop $var );
        return @
implode " "$var ) . flush();
    }
}

function 
get_page_html$url$Refer=''$proxy=''$post=''$num=''$Cookie='' )
{

    
$agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)";

    
$curltop curl_init();
    if ( !empty ( 
$proxy ) )
    {
        
curl_setopt$curltopCURLOPT_PROXY$proxy );
    }
    
curl_setopt$curltopCURLOPT_URL$url );
    if ( !empty( 
$Refer ) )
    {
        
curl_setopt$curltopCURLOPT_REFERER$Refer );
    }
    
curl_setopt$curltopCURLOPT_USERAGENT$agent );
    
curl_setopt$curltopCURLOPT_RETURNTRANSFER);
    
curl_setopt$curltopCURLOPT_FOLLOWLOCATION);
    if ( empty( 
$Cookie ) )
    {
        
$cookiefile 'cookie.inc';
        if ( !
file_exists$cookiefile ) )
        {
            
$handle fopen$cookiefile'w' );
            
chmod'cookie.inc'0666 );
            
fclose$handle );
        }
        
curl_setopt$curltopCURLOPT_COOKIEFILE$cookiefile );
        
curl_setopt$curltopCURLOPT_COOKIEJAR$cookiefile );
    }
    else
    {
        
curl_setopt$curltopCURLOPT_COOKIE$Cookie );
    }
    
curl_setopt$curltopCURLOPT_TIMEOUT15 );
    if ( 
$num == )
    {
        
curl_setopt$curltopCURLOPT_HEADER);
    }
    if ( !empty( 
$post ) )
    {
        
curl_setopt$curltopCURLOPT_POST);
        
curl_setopt$curltopCURLOPT_POSTFIELDS$post );
    }
    
$html curl_exec$curltop );
    
//echo $html;
    
curl_close $curltop );
    return  !empty( 
$html )  ?  $html :  false;
    
}

function 
grab (  $proxing$TimeGrabProx )
{
    
$FileRezer file 'proxy.txt' );
    
$file_prox fopen 'proxy.txt''w+' );
    
flock$file_proxLOCK_EX );
    
$ArrayLinc[] = 'http://freeproxylist.org/en/free-proxy-list.htm';
    for ( 
$p 1$p <= 50$p ++ )
    {
        
$ArrayLinc[$p] = 'http://freeproxylist.org/en/free-proxy-list.htm?index='.$p ;
    }
    foreach ( 
$ArrayLinc as $key => $Linc )
    {

        if ( 
$key == )
        {
            
$PostSend 'cc=any&ssl=any&speed=0&port=any&connect=any&ping=15.0000&type=any&post=any&uptime=0&section=both&codeen=any&interval=360&userip=94.178.217.103&code=AW1VfWYjMueusyuh&filter=save+and+apply+filter+options';
        }
        else
        {
            
$PostSend null;
        }

        
$Prox get_page_html Null$LincNullNull$PostSend);
        if ( !empty( 
$Prox ) )
        {
            
preg_match_all"/(\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}:\d{0,6})/"$Prox$ProxSort );
            if ( !empty ( 
$ProxSort[1][0] ) )
            {
                
//print $Linc ." Ok!<br />"; flush();

                
for ( $i 0$i count $ProxSort[1] ); $i ++ )
                {
                    
fwrite$file_prox$ProxSort[1][$i]."\n" );
                }
                
$prox_url_ok true;
            }

        }
        else
        {
            if ( ( 
$p ) == $key )
            {
                if ( 
filesize'proxy.txt' ) <= 10 )
                {
                    
fwrite$file_prox, @implode""$FileRezer ) );
                    
$prox_url_ok false;
                }
            }

        }
    }
    
flock$file_proxLOCK_UN);
    
fclose$file_prox );
    
count_prox (  $TimeGrabProx );
    return 
$prox_url_ok;
}
?>
 
Ответить с цитированием

  #13777  
Старый 14.12.2009, 01:39
Аватар для Matnya
Matnya
Banned
Регистрация: 02.12.2009
Сообщений: 23
Провел на форуме:
48201

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

как узнать ПО сервера (из заголовка) средсвами ПХП. т.е. надо написать скрипт который читает загаловок сервера.
 
Ответить с цитированием

  #13778  
Старый 14.12.2009, 08:11
Аватар для krypt3r
krypt3r
Познавший АНТИЧАТ
Регистрация: 27.04.2007
Сообщений: 1,044
Провел на форуме:
3660186

Репутация: 905


По умолчанию

PHP код:
<?php
  $url 
'http://linux.org.ru/';
  
$c curl_init ();
  
curl_setopt ($cCURLOPT_URL$url);  
  
curl_setopt ($cCURLOPT_HEADER1); 
  
curl_setopt ($cCURLOPT_RETURNTRANSFER1); 
  
curl_setopt ($cCURLOPT_REFERER$url); 
  
curl_setopt ($cCURLOPT_USERAGENT'Mozilla/5.0'); 
  
curl_setopt ($cCURLOPT_FOLLOWLOCATION1); 
  
curl_setopt ($cCURLOPT_NOBODY1);
  
$res curl_exec ($c); 
  
curl_close ($c); 
  
preg_match ('/Server:\s+(.+?)\r\n/'$res$m);
  echo 
$m[1];
?>
 
Ответить с цитированием

  #13779  
Старый 14.12.2009, 21:00
Аватар для qW1zer
qW1zer
Участник форума
Регистрация: 24.08.2009
Сообщений: 145
Провел на форуме:
285318

Репутация: 17
Отправить сообщение для qW1zer с помощью ICQ
Post

Подскажите пожалуйста,это вроде как к регуляркам относится!
В общем есть переменная,получаем через POST пример:
PHP код:
$param=$_POST['value']; 
я делаю проверку
PHP код:
if ($param == 'Значение')
{
действие

Но проблема в том,что первая часть $param постоянная,к примеру setname,а вторая постоянно меняется и содержит она цифры и буквы.
К примеру так
Код:
setname vasyapupkin123
Можно как-нибудь определить или понять что переменная содержит setname A-Z;0-9 или что-то подобное..заранее спасибо
 
Ответить с цитированием

  #13780  
Старый 14.12.2009, 21:06
Аватар для Kaimi
Kaimi
Reservists Of Antichat - Level 6
Регистрация: 23.08.2007
Сообщений: 1,237
Провел на форуме:
18127311

Репутация: 1676


Отправить сообщение для Kaimi с помощью ICQ
По умолчанию

Наверное так
PHP код:
<?php
if(preg_match('/^setname [0-9a-z]+$/i'$param))
{
действие
}
?>
 
Ответить с цитированием
Ответ



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
[c/c++] Новичкам: задаем вопросы _Great_ С/С++, C#, Delphi, .NET, Asm 5420 17.06.2010 13:33
Интернетчики задали российскому президенту очень странные вопросы podkashey Мировые новости 4 07.07.2006 16:53
Вопросы по Ipb 2.0 Voodoo_People Форумы 26 15.02.2005 22:57



Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT.XYZ