Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. <form action='http://www.xxx.com/wp-content/xx/xx/recive.php' method='post' class="my-form_recibos" target='hidden-form'>
  2. <label> <input type='checkbox' autocomplete="off" class="" name='enviarmail' value='yes' >enviar pedido de recibos ?</label>
  3.  
  4. <input type="hidden" name="result" value="<?php $array_dos_pagamentos); ?>">
  5.  
  6. <input type='Submit' value='Salvar' onclick='saved(<?php echo $fid ?>)' />
  7. </form>
  8.  
  9. Array ( [0] => Array ( [nome] => Claudia Mateus [total] => 20 [email] => claudiamateux@gmail.com ) [1] => Array ( [nome] => Joana Gonçalves [total] => 20 [email] => joanagoncalves95@hotmail.com ) [2] => Array ( [nome] => Paulo Abreu [total] => 20 [email] => pda9891@gmail.com ) )
  10.  
  11. <?
  12. $json = json_encode($array_dos_pagamentos);
  13. // Isto ira converter a array em json
  14. ?>
  15. <input type="hidden" name="result" value="<?= htmlentities($json, ENT_QUOTES, 'UTF-8') ?>">
  16.  
  17. <?
  18. $array = json_decode($_POST['result'], true);
  19. // Isto irá tornar o JSON em array
  20. ?>
  21.  
  22. <?
  23.  
  24. $serialize = serialize($array_dos_pagamentos);
  25. $hmac = hash_hmac('sha384', $serialize, 'SUA_SENHA');
  26.  
  27. $value = $hmac.$serialize;
  28.  
  29. ?>
  30. <input type="hidden" name="result" value="<?= htmlentities($value, ENT_QUOTES, 'UTF-8') ?>">
  31.  
  32. $value = $_POST['result'];
  33.  
  34. $hmac = mb_substr($value, 0, 96, '8bit');
  35. $serialize = mb_substr($value, 96, null, '8bit');
  36.  
  37. if(hash_equals($hmac, hash_hmac('sha384', $serialize, 'SUA_SENHA'))){
  38. $array = unserialize($serialize);
  39. }
  40.  
  41. <input type="hidden" name="result" value="<?php echo json_encode( $array_dos_pagamentos); ?>">
  42.  
  43. <?php
  44. $json = json_decode($_POST['result'], true) or die(json_last_error());
  45. echo '<pre>';
  46. print_r($json);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement