The protect() MD5 Form Fingerprint Generator
<?php
define('PROTECTED_KEY', 'mysecretword');
function my_addslashes($string) {
return (get_magic_quotes_gpc() == 1) ? $string : addslashes($string);
}
function protect($name, $value, $secret) {
$tag = "";
$seed = md5($name.$value.$secret);
$html_name = $name."_checksum";
$tag = "<INPUT TYPE='hidden' NAME='$name' VALUE='" .
urlencode(my_addslashes($value))."'>\n";
$tag .= "<INPUT TYPE='hidden' NAME='$html_name' VALUE='$seed'>\n";
return $tag;
}
?>
Related examples in the same category