Advertisement
Guest User

Untitled

a guest
Jan 29th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <?php
  2.  
  3. $panel_url = 'http://example.com:23462/';
  4.  
  5. $username = $_GET['payer_email'];
  6. $invoice = $_GET['txn_id'];
  7. $trimmedinvoice = substr($invoice, -6);
  8. $password = $trimmedinvoice;
  9. $max_connections = 1;
  10. $reseller = 0;
  11. $bouquet_ids = array(
  12. 1,
  13. 2,
  14. 3 );
  15.  
  16. $expirationdays = $_GET['custom'];
  17. $expiration = "+$expirationdays day";
  18. $expiredate = strtotime($expiration);
  19.  
  20. ###############################################################################
  21. $post_data = array( 'user_data' => array(
  22. 'username' => $username,
  23. 'password' => $password,
  24. 'max_connections' => $max_connections,
  25. 'is_restreamer' => $reseller,
  26. 'exp_date' => $expiredate,
  27. 'bouquet' => json_encode( $bouquet_ids ) ) );
  28.  
  29. $opts = array( 'http' => array(
  30. 'method' => 'POST',
  31. 'header' => 'Content-type: application/x-www-form-urlencoded',
  32. 'content' => http_build_query( $post_data ) ) );
  33.  
  34. $context = stream_context_create( $opts );
  35. $api_result = json_decode( file_get_contents( $panel_url . "api.php?action=user&sub=create", false, $context ) );
  36.  
  37. Echo "<b>Username:</b> <br>";
  38. echo $username;
  39.  
  40. echo "<br></br>";
  41. echo "<b>Password:<br></b>";
  42. echo $password;
  43.  
  44. echo "<br></br>";
  45. echo "<b>Expires (in unix time):<br></b>";
  46. echo $expiredate;
  47.  
  48. ?>
  49.  
  50. print "CONTENT_TYPE: " . $_SERVER['CONTENT_TYPE'] . "<BR />";
  51. $data = file_get_contents('php://input');
  52. print "DATA: <pre>";
  53. var_dump($data);
  54. var_dump($_POST);
  55. print "</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement