Custom Security Code Captcha in php

 


 <label>Security Code * </label>

<input type="text" max="5" required="required" autocomplete="off" style="text-align:center; width:150px;" name="security_code" id="security_code" />

<span class="scode">

<?php

//--------------------------------

$ranStr = md5(microtime());

$ranStr = substr($ranStr, 0, 5);

$_SESSION['captcha'] = $ranStr;

//--------------------------------

echo $_SESSION['captcha'];

?>

</span>

Previous
Next Post »