<?php
# include the shield
include_once('class.shield.php');
# delcare the shield
$shield = new shield();
$shield->ON_ERROR = SHIELD_VERBOSE;
if(isset($_POST['Submit']))
{
?>
This is what has been sent via POST. You can see that the var names have been sent however the values are protected.<br />
<br />
<pre>
<?php
print_r($_POST);
?>
</pre>
<br />
<br />
It is not possible to expose them all at once as they have been done individually. You should also note that the kill<br />
value sent has been digitally signed with it's own key, thus keeping it from being read by anyone without the key.<br />
<br />
<pre>
<?php
echo '$_POST["devil"] = ' . $shield->expose($_POST['devil'])."<br />";
echo '$_POST["goto"] = ' . $shield->expose($_POST['goto'])."<br />";
echo '$_POST["kill"] = ' . $shield->expose($_POST['kill'], false)." - no key<br />";
echo '$_POST["kill"] = ' . $shield->expose($_POST['kill'], false, 'Secret Target')." - correct key<br />";
exit;
}
?>
</pre>
This example creates a get string for the form action param.<br />
Check out the source code.<br />
<br />
<?php
# the data to be transmitted
$data['devil'] = $shield->protect('666');
$data['goto'] = $shield->protect('Narnia');
$data['kill'] = $shield->protect('pixies', SHIELD_PLAIN, 0, false, 'Secret Target');
?>
<form name="shield_test" method="post" action="">
<input type="hidden" name="devil" value="<?php echo $data['devil']; ?>" />
<input type="hidden" name="goto" value="<?php echo $data['goto']; ?>" />
<input type="hidden" name="kill" value="<?php echo $data['kill']; ?>" />
<input type="submit" id="Submit" name="Submit" value="Sumbit Shielded Data" />
</form>