Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $panel_url = 'http://example.com:23462/';
- $username = $_GET['payer_email'];
- $invoice = $_GET['txn_id'];
- $trimmedinvoice = substr($invoice, -6);
- $password = $trimmedinvoice;
- $max_connections = 1;
- $reseller = 0;
- $bouquet_ids = array(
- 1,
- 2,
- 3 );
- $expirationdays = $_GET['custom'];
- $expiration = "+$expirationdays day";
- $expiredate = strtotime($expiration);
- ###############################################################################
- $post_data = array( 'user_data' => array(
- 'username' => $username,
- 'password' => $password,
- 'max_connections' => $max_connections,
- 'is_restreamer' => $reseller,
- 'exp_date' => $expiredate,
- 'bouquet' => json_encode( $bouquet_ids ) ) );
- $opts = array( 'http' => array(
- 'method' => 'POST',
- 'header' => 'Content-type: application/x-www-form-urlencoded',
- 'content' => http_build_query( $post_data ) ) );
- $context = stream_context_create( $opts );
- $api_result = json_decode( file_get_contents( $panel_url . "api.php?action=user&sub=create", false, $context ) );
- Echo "<b>Username:</b> <br>";
- echo $username;
- echo "<br></br>";
- echo "<b>Password:<br></b>";
- echo $password;
- echo "<br></br>";
- echo "<b>Expires (in unix time):<br></b>";
- echo $expiredate;
- ?>
- print "CONTENT_TYPE: " . $_SERVER['CONTENT_TYPE'] . "<BR />";
- $data = file_get_contents('php://input');
- print "DATA: <pre>";
- var_dump($data);
- var_dump($_POST);
- print "</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement