<?

function vrchtml()
{
global $urlclscrpt, $msg2;


$tmvl1=time();
$tmsrt=substr($tmvl1,-5);


$urlimgcd=$urlclscrpt."vrfcd.php?idcd=$tmsrt";
$html="
<table width='500' border=0 cellspacing=1 cellpadding=1>
<tr><td width='350'>
 ".$msg2['entr_vrfcode']."
<input type='text' name='verfcode' size='5' class=formst>
<input type='hidden' name='vcdnumb' value='$tmvl1'>
 
</td><td width='150' >
<img src='$urlimgcd'> 
</td></tr></table>
<br>
 
";

return $html;
}

function cr_vrcd($idcd)
{
$crcodev=crypt($idcd,'aa');
$crcodev=substr($crcodev,2,5);
$crcodev=strtolower($crcodev);

$crcodev=ereg_replace('l','a',$crcodev);
$crcodev=ereg_replace('/','b',$crcodev);
$crcodev=ereg_replace('\.','c',$crcodev);
$crcodev=ereg_replace('0','d',$crcodev);
$crcodev=ereg_replace('o','e',$crcodev);
$crcodev=ereg_replace('1','f',$crcodev);

return $crcodev;
}

function ch_vrcode()
{
global $_REQUEST, $msg2;
 
$vcdshrt=substr($_REQUEST['vcdnumb'],-5);

$tmrslt=time()-$_REQUEST['vcdnumb'];

$crcdv1=cr_vrcd($vcdshrt); 

$vrfcd=strtolower($_REQUEST['verfcode']);

if(($crcdv1!=$vrfcd) or ($tmrslt > 7000) ){
$message=$msg2['vrf_cd_notcor'];
output_message($message);
exit;

}
}

?>