Guest User

Untitled

a guest
Apr 23rd, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. xhr.onreadystatechange = function() {
  2. if (xhr.readyState == 4 && xhr.status==200) {
  3. token=xhr.responseText;
  4. //add value/field to form
  5. txCvv = txJ$(".cvv").val();
  6. var MyForm = txJ$(".submit").closest("form");
  7. if (txJ$('#cipherText').length > 0) {
  8. txJ$('#cipherText').val(txCryptData);
  9. }
  10. else
  11. {
  12. txJ$('<input type="hidden">').attr({
  13. id: 'token',
  14. name: 'token'
  15. }).val(token).appendTo(MyForm);
  16. txJ$('<input type="hidden">').attr({
  17. id: 'cvv',
  18. name: 'cvv'
  19. }).val(txCvv).appendTo(MyForm);
  20.  
  21.  
  22.  
  23. }
  24.  
  25. //scrub data that we do not want to post
  26. txJ$(".data").removeAttr('name');
  27. txJ$(".cvv").removeAttr('name');
  28. }
  29. }
  30. xhr.open('POST', 'tokenize.php', true);
  31. xhr.send(params);
  32.  
  33. <?php
  34. $encrypted_data = file_get_contents("php://input");
  35. //There are some codes here.
  36. echo $output;
  37. <?
Add Comment
Please, Sign In to add comment