Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4 && xhr.status==200) {
- token=xhr.responseText;
- //add value/field to form
- txCvv = txJ$(".cvv").val();
- var MyForm = txJ$(".submit").closest("form");
- if (txJ$('#cipherText').length > 0) {
- txJ$('#cipherText').val(txCryptData);
- }
- else
- {
- txJ$('<input type="hidden">').attr({
- id: 'token',
- name: 'token'
- }).val(token).appendTo(MyForm);
- txJ$('<input type="hidden">').attr({
- id: 'cvv',
- name: 'cvv'
- }).val(txCvv).appendTo(MyForm);
- }
- //scrub data that we do not want to post
- txJ$(".data").removeAttr('name');
- txJ$(".cvv").removeAttr('name');
- }
- }
- xhr.open('POST', 'tokenize.php', true);
- xhr.send(params);
- <?php
- $encrypted_data = file_get_contents("php://input");
- //There are some codes here.
- echo $output;
- <?
Add Comment
Please, Sign In to add comment