Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function randString($length, $charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')
- {
- $str = '';
- $count = strlen($charset);
- while ($length--) {
- $str .= $charset[mt_rand(0, $count-1)];
- }
- return $str;
- }
- $username = ''; //login
- $password = ''; //hasło
- $loginUrl = 'http://xn.pl/index.php?strona=konto';
- //init curl
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $loginUrl);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'userid='.$username.'&haslo='.$password.'&zaloguj=Ok');
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- //execute the request (the login)
- $store = curl_exec($ch);
- echo 'Zalogowano ';
- //Adding alias
- $aliasUrl = 'http://xn.pl/index.php?strona=konto&id=2';
- $aliasDdomain = ' LINK BEZ WWW ANI HTTP '.rand(1,99999999); //tutaj domena jaka ma byc podpięta pod alias oraz randomowa liczba od 1 do 99999999 WAŻNE! adres strony bez http://, https:// czy wwww
- $aliasName = randString(10); //10 to liczba generowanych znaków
- curl_setopt($ch, CURLOPT_URL, $aliasUrl);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'dodaj_alias=Ok&alias='.$aliasName.'&domena=xn.pl&url='.$aliasDdomain.'&kategoria=6');
- $added = curl_exec($ch);
- echo 'Dodano';
- //wylogowywanie z serwisu (nie potrzebne aktualnie)
- /*
- $logoutUrl = 'http://xn.pl/index.php?strona=konto&id=3';
- //Set the URL to work with
- curl_setopt($ch, CURLOPT_URL, $logoutUrl);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $logout = curl_exec($ch);
- echo $logout;
- */
- curl_close($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement