Insert a unique ID into a form : md5 « Utility Function « PHP






Insert a unique ID into a form

 
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME'] ?>"
      onsubmit="document.getElementById('submit-button').disabled = true;">
<!-- insert all the normal form elements you need -->
<input type='hidden' name='token' value='<?php echo md5(uniqid()) ?>'/>
<input type='submit' value='Save Data' id='submit-button'/>
</form>
  
  








Related examples in the same category

1.Checking for session hijacking
2.string md5 ( string str [, bool raw_output] )
3.string md5 ( string str [, bool raw_output] ) produces a data checksum in exactly the same way as sha1( );
4.Creating an md5 signature
5.PHP's basic md5() function
6.The protect() MD5 Form Fingerprint Generator
7.md5.php