Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. function generateRandomString($length = 10) {
  4. $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  5. $charactersLength = strlen($characters);
  6. $randomString = '';
  7. for ($i = 0; $i < $length; $i++) {
  8. $randomString .= $characters[rand(0, $charactersLength - 1)];
  9. }
  10. return $randomString;
  11. }
  12.  
  13. echo 'Enter Referral Code : ';
  14. $ref = trim(fgets(STDIN));
  15. $ch = curl_init();
  16. curl_setopt($ch, CURLOPT_URL, 'http://www.getapsychologist.com/ceviroynaparakaza/sc.php');
  17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  18. curl_setopt($ch, CURLOPT_POSTFIELDS, '{
  19.  
  20. "name": "'.generateRandomString(16).'",
  21. "email": "'.generateRandomString(10).'@gmail.com",
  22. "password": "anjir123",
  23. "ref": "'.$ref.'",
  24. "cihazkimlik": "1D189879CEA73E11"
  25. }');
  26. curl_setopt($ch, CURLOPT_POST, 1);
  27. curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  28.  
  29. $headers = array();
  30. $headers[] = 'Content-Type: multipart/form-data';
  31. $headers[] = 'Host: www.getapsychologist.com';
  32. $headers[] = 'Content-Disposition: /form-data="name,email,password,ref,cihazkimlik"';
  33. $headers[] = 'User-Agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; SM-G610F Build/M1AJQ)';
  34.  
  35. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  36.  
  37. $result = curl_exec($ch);
  38. if (curl_errno($ch)) {
  39. echo 'Error:' . curl_error($ch);
  40. }
  41. curl_close ($ch);
  42.  
  43. $json = json_decode($result);
  44.  
  45. if($json->success == 0){
  46. echo $json->error->message;
  47. die();
  48.  
  49. }
  50.  
  51. echo $json->ref." Berhasil ";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement