Guest User

KeyGenerator.php

a guest
Dec 16th, 2012
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.47 KB | None | 0 0
  1. <?php
  2.  
  3. include('PaymentSettings.php');
  4.  
  5. # Copyright (c) 2001-2006 element 5, (c) 2006 Digital River GmbH
  6. #
  7. # NOTE: in order work with HTTP headers you have to make sure
  8. # that '<?php' are really the first characters in your file
  9.  
  10. # check for errors
  11. if ( 1 == 2 ) {
  12.   # an error has occured
  13.  
  14.   # set the status code other than 200
  15.  Header("HTTP/1.1 400 Bad Request");
  16.  
  17.   # present the error
  18.  echo "BAD_INPUT\n";
  19.  
  20.   # nothing else to do
  21.  exit;
  22. }
  23.  
  24. # calculate the key
  25.  
  26. $quantity = $_POST['QUANTITY'];
  27. $firstName = $_POST['FIRSTNAME'];
  28. $lastName = $_POST['LASTNAME'];
  29. $custEmail = $_POST['EMAIL'];
  30. $CompanyName = $_POST['RESELLER'];
  31. $AppName = $_POST['REG_NAME'];
  32.  
  33. # enter your secret key generation code here
  34. // Client has successfully paid for the product
  35. debug_log('Creating product Information to send.',true);
  36.  
  37. // This calls the function in PaymentSettings.php that
  38. // creates the product keys and send them to the user
  39. $key = SendPKeys($quantity, $custEmail, $firstName, $lastName, $CompanyName, $AppName);
  40.  
  41. debug_log('paychecker finished.',true,true);
  42.  
  43. # present the key
  44.  
  45. # the key to be presented inline
  46. Header ('Content-Type: text/plain');
  47.  
  48. # if your key is a binary use the following headers instead
  49. # set the mime type
  50. #Header ('Content-Type: application/octet-stream');
  51. # set the filename for the binary key. Replace 'key.bin' by a filename you want
  52. #Header ('Content-Disposition: filename=key.bin');
  53.  
  54. # now print the key
  55. echo $key;
  56.  
  57. php?>
Advertisement
Add Comment
Please, Sign In to add comment