Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action='http://www.xxx.com/wp-content/xx/xx/recive.php' method='post' class="my-form_recibos" target='hidden-form'>
- <label> <input type='checkbox' autocomplete="off" class="" name='enviarmail' value='yes' >enviar pedido de recibos ?</label>
- <input type="hidden" name="result" value="<?php $array_dos_pagamentos); ?>">
- <input type='Submit' value='Salvar' onclick='saved(<?php echo $fid ?>)' />
- </form>
- 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 ) )
- <?
- $json = json_encode($array_dos_pagamentos);
- // Isto ira converter a array em json
- ?>
- <input type="hidden" name="result" value="<?= htmlentities($json, ENT_QUOTES, 'UTF-8') ?>">
- <?
- $array = json_decode($_POST['result'], true);
- // Isto irá tornar o JSON em array
- ?>
- <?
- $serialize = serialize($array_dos_pagamentos);
- $hmac = hash_hmac('sha384', $serialize, 'SUA_SENHA');
- $value = $hmac.$serialize;
- ?>
- <input type="hidden" name="result" value="<?= htmlentities($value, ENT_QUOTES, 'UTF-8') ?>">
- $value = $_POST['result'];
- $hmac = mb_substr($value, 0, 96, '8bit');
- $serialize = mb_substr($value, 96, null, '8bit');
- if(hash_equals($hmac, hash_hmac('sha384', $serialize, 'SUA_SENHA'))){
- $array = unserialize($serialize);
- }
- <input type="hidden" name="result" value="<?php echo json_encode( $array_dos_pagamentos); ?>">
- <?php
- $json = json_decode($_POST['result'], true) or die(json_last_error());
- echo '<pre>';
- print_r($json);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement