<?
$salt = "give_me_in_video_iam_good";
$domain = $_SERVER['HTTP_HOST'];
if ( strstr( $domain, "http://" ) )
{
$domain = str_replace( "http://", "", $domain );
}
if ( substr( $domain, 0, 4 ) == "www." )
{
$domain = substr( $domain, 4 );
}
$code = $salt."^".$domain;
$code = md5( $code );
$code = strtoupper( $code );
$code_bl[0] = substr( $code, 0, 8 );
$code_bl[1] = substr( $code, 8, 8 );
$code_bl[2] = substr( $code, 16, 8 );
$code_bl[3] = substr( $code, 24, 8 );
$code = $code_bl[2]."-".$code_bl[1]."-".$code_bl[0]."-".$code_bl[3];
echo 'Ключ для домена '.$_SERVER['HTTP_HOST'].': '.$code;
?>