Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //===========CopyRight nih Tolo ajg Bangsd=============
- echo "Username : ";
- $user = trim(fgets(STDIN, 1024));
- echo "Password : ";
- $passwd = trim(fgets(STDIN, 1024));
- //===========CopyRight nih Tolo ajg Bangsd=============
- //===========REQUEST METHOD=============
- $data = '{"action":"login","username":"'.$user.'","password":"'.$passwd.'"}';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_URL, 'https://files.000webhost.com/handler.php?action=login');
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
- $res = curl_exec($ch);
- //===========REQUEST METHOD=============
- //===========GET TITLE / Opsional=============
- $ch2 = curl_init();
- curl_setopt($ch2, CURLOPT_URL, 'https://files.000webhost.com/');
- curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch2, CURLOPT_HEADER, 0);
- $res2 = curl_exec($ch2);
- //===========GET TITLE / Opsional=============
- //===========Info=============
- preg_match('/<title>(.*?)<\/title>/',$res2,$title);
- echo $title[1]."<br>";
- if (preg_match('/true/',$res)) {
- preg_match('/<title>(.*?)<\/title>/',$res,$f);
- echo "Sukses Login...<br><br>Response";
- echo "<br>=========================<br>";
- print_r($res);
- echo "<br>=========================<br>";
- } else {
- echo "Gagal Login Bos...<br>";
- }
- //===========Info=============
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement