· 7 years ago · Jan 18, 2019, 05:48 PM
1?php
2
3 function get_input_tags($html)
4 {
5 $post_data = array();
6
7 // a new dom object
8 $dom = new DomDocument;
9
10 //load the html into the object
11 $dom->loadHTML($html);
12 //discard white space
13 $dom->preserveWhiteSpace = false;
14
15 //all input tags as a list
16 $input_tags = $dom->getElementsByTagName('input');
17
18 //get all rows from the table
19 for ($i = 0; $i < $input_tags->length; $i++)
20 {
21 if( is_object($input_tags->item($i)) )
22 {
23 $name = $value = '';
24 $name_o = $input_tags->item($i)->attributes->getNamedItem('name');
25 if(is_object($name_o))
26 {
27 $name = $name_o->value;
28
29 $value_o = $input_tags->item($i)->attributes->getNamedItem('value');
30 if(is_object($value_o))
31 {
32 $value = $input_tags->item($i)->attributes->getNamedItem('value')->value;
33 }
34
35 $post_data[$name] = $value;
36 }
37 }
38 }
39
40 return $post_data;
41 }
42
43 //echo file_get_contents('https://gamekairos.org/');
44
45 $token = get_input_tags(file_get_contents('https://gamekairos.org/'))['_token'];
46
47 function send(){
48 $ch = curl_init();
49
50 $data = array(
51 'username' => 'quenedigay'. rand(100, 999990),
52 'password' => '123456',
53 'email' => 'gay'. rand(99, 9999999) .'@gmail.com',
54 'passwordRepeat' => '123456'
55 );
56
57 $payload = json_encode($data);
58 curl_setopt($ch, CURLOPT_URL,"https://gamekairos.org/index.php");
59 curl_setopt($ch, CURLOPT_POST, 1);
60 //curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
61 curl_setopt($ch, CURLOPT_POSTFIELDS, '_token='. $token .'&name=afdas&email=adfdas%40gamlc.omc&Password=aadsfas&Password1=adfasdf&g-recaptcha-response=6Levj2oUAAAAAFcLb8CmiL10yL2jxAe2P8evXrjR');
62 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
63 //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
64 $resultado = curl_exec($ch);
65 curl_close($ch);
66
67 echo $resultado;
68 }
69
70 send();
71 /*
72
73 for ($i = 0; $i < 50; $i++){
74 send();
75 }*/
76?>