ANTICHAT

ANTICHAT (https://forum.antichat.io/index.php)
-   PHP (https://forum.antichat.io/forumdisplay.php?f=37)
-   -   [php] Заполнение форм (https://forum.antichat.io/showthread.php?t=154608)

Хелпер 07.11.2009 14:03

[php] Заполнение форм
 
Итак. Суть задачи скрипта:
Открывает страницу http://forma.net/index.php
На странице html форма с несколькими полями. Например:
Код HTML:

<form action="res.php" method="post">
<input type="text" name="login">
<input type="text" name="pass">
<input type="text" name="email">
<input type="submit">
</form>

Вводит буквенное имя длиной от 4 до 10 символов, вводит пароль, идентичный имени, и емаил следущим образом:
имя@любые_буквосочетания(тÐ ¾чка)любые_быквосочетания
и жмет интер.
А затем все заново.
Никаких логов и статистик не нужно.

Так же желательно использование прокси серверов из txt документа.

Если кто-то возьмется бесплатно, буду рад, ну а если работа требует оплаты - ваши предложения. Мне надо для выпускной работы.

Gray_Wolf 07.11.2009 14:21

Передаёте функции полный путь до вашего res.php и она отсылает нужные вам данные
PHP код:

function get_page($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "login=Vasya&pass=Vasya&email=Vasya@mail.ru");
$result = curl_exec($ch);
curl_close($ch);
} 


GreenBear 07.11.2009 14:22

Цитата:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
=>
Цитата:

$ch = curl_init($url);
ну это просто так, так тоже можно

b3 07.11.2009 15:17

Тока чет по адресу http://forma.net/index.php я не увидел формы =)
PHP код:

<?php
set_time_limit
(0);
$proxylist = file('proxy.txt');
$proxylist = array_map('trim',$proxylist);

foreach (
$proxylist as $proxy) {

$ch = curl_init('http://forma.net/index.php');
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_REFERER, $url);
curl_setopt($ch,CURLOPT_TIMEOUT, 5);

curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, 'login=admin&pass=123456&email=admin@admin.ru');

curl_setopt($ch,CURLOPT_COOKIEJAR, './cook');
curl_setopt($ch,CURLOPT_COOKIEFILE, './cook');

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox-Zalupa/3');
curl_setopt($ch, CURLOPT_PROXY, $proxy);
$content = curl_exec($ch);
curl_close($ch);

}
?>


Хелпер 07.11.2009 16:39

вы немного не поняли задания. После выполнения цикла необходимо генерировать имя пароль маил и заново выполнять цикл.

b3 07.11.2009 22:47

В цикле повставляй вызов функций.

PHP код:

function namegen($length)
{
$result = '';
$vals = "abcdefghijklmnopqrstuvwxyz0123456789";
for(
$i=1; $i<=$length; $i++)
{
$result .= $vals{rand(0, strlen($vals) - 1)};
}
return 
$result;
} 

PHP код:

function passgen($length)
{
$result = '';
$vals = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_-+";
for(
$i=1; $i<=$length; $i++)
{
$result .= $vals{rand(0, strlen($vals) - 1)};
}
return 
$result;
} 

PHP код:

function mail_gen($length)
{
$result = '';
$vals = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_-+";
for(
$i=1; $i<=$length; $i++)
{
$result .= $vals{rand(0, strlen($vals) - 1)};
}
$result .= $result.'@mail.ru';
return 
$result;
} 


Хелпер 08.11.2009 00:29

Цитата:

Сообщение от b3
Тока чет по адресу http://forma.net/index.php я не увидел формы =)
PHP код:

<?php
set_time_limit
(0);
$proxylist = file('proxy.txt');
$proxylist = array_map('trim',$proxylist);

foreach (
$proxylist as $proxy) {

$ch = curl_init('http://forma.net/index.php');
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_REFERER, $url);
curl_setopt($ch,CURLOPT_TIMEOUT, 5);

curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, 'login=admin&pass=123456&email=admin@admin.ru');

curl_setopt($ch,CURLOPT_COOKIEJAR, './cook');
curl_setopt($ch,CURLOPT_COOKIEFILE, './cook');

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox-Zalupa/3');
curl_setopt($ch, CURLOPT_PROXY, $proxy);
$content = curl_exec($ch);
curl_close($ch);

}
?>


в каком формате должен быть файл с проксями?
xxx.xxx.xxx.xxx:port
xxx.xxx.xxx.xxx:port
TAK?

И как передать фун-ии адрес до res.php?

b3 08.11.2009 06:46

Цитата:

в каком формате должен быть файл с проксями?
IP:PORT
Цитата:

И как передать фун-ии адрес до res.php?
Неебу о каком res.php вообще идет речь.

Вот вообщем слепил в кучу на всякий случай.
PHP код:

<?php 
set_time_limit
(0); 
$proxylist = file('proxy.txt'); 
$proxylist = array_map('trim',$proxylist); 

foreach (
$proxylist as $proxy) { 

$login = namegen(8);
$pass = passgen(10);
$email = mail_gen(8);

$ch = curl_init('http://forma.net/index.php'); 
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 0); 
curl_setopt($ch,CURLOPT_REFERER, 'http://rambler.ru'); 

curl_setopt($ch,CURLOPT_POST, 1); 
curl_setopt($ch,CURLOPT_POSTFIELDS, 'login='.$login.'&pass='.$pass.'&email='.$email); 

curl_setopt($ch,CURLOPT_COOKIEJAR, './cook'); 
curl_setopt($ch,CURLOPT_COOKIEFILE, './cook'); 

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox-Zalupa/3'); 
curl_setopt($ch, CURLOPT_PROXY, $proxy); 
curl_setopt($ch,CURLOPT_TIMEOUT, 5);

$content = curl_exec($ch); 
curl_close($ch); 

} 

/* FUNCTIONS */

function namegen($length) 
{ 
$result = ''; 
$vals = "abcdefghijklmnopqrstuvwxyz0123456789"; 
for(
$i=1; $i<=$length; $i++) 
{ 
$result .= $vals{rand(0, strlen($vals) - 1)}; 
} 
return 
$result; 
} 

function 
passgen($length) 
{ 
$result = ''; 
$vals = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_-+"; 
for(
$i=1; $i<=$length; $i++) 
{ 
$result .= $vals{rand(0, strlen($vals) - 1)}; 
} 
return 
$result; 
} 
function 
mail_gen($length) 
{ 
$result = ''; 
$vals = "abcdefghijklmnopqrstuvwxyz0123456789"; 
for(
$i=1; $i<=$length; $i++) 
{ 
$result .= $vals{rand(0, strlen($vals) - 1)}; 
} 
$result = $result.'@mail.ru'; 
return 
$result; 
} 
?>


Osip 08.11.2009 08:36

Цитата:

<form action="res.php" method="post">
он про это...
ссылку сам поменяй с
http://forma.net/index.php на
http://forma.net/res.php

Хелпер 08.11.2009 14:30

Я видимо тупой, свяжите все в одно пожалста.


Время: 13:34