Home › Forums › Back End › how can i protect my template from thiefs …? › Re: how can i protect my template from thiefs …?
February 18, 2012 at 5:48 am
#96916
Participant
my idea that i working on it now is to make a code that will ba generated from a program that i made , then when any clients apply for a template the program generate a code on somewhere in some files that will be confirmed by another function i added it on the template files ..
the generated code include :
– client site .
– starting date ,
– id number , he can get it by us ..
but also it is not fully protected …
my friend suggest me to apply a trick with generating code, by replacing the most comment function i used in a code …
like :
function encode($file)
{
$func = array(
'fopen',
'class',
'echo',
'if',
'else',
'elseif',
'for',
'while',
'foreach',
'function',
'include',
'print',
'eval',
'file_get_contents',
);
$enc = array(
'#30#',
'#31#',
'#32#',
'#33#',
'#34#',
'#35#',
'#36#',
'#37#',
'#38#',
'#39#',
'#40#',
'#41#',
'#42#',
'#43#',
);
$str = array(
';',
'"',
''',
'==',
'=',
'===',
'>',
'>=',
'<=',
'!',
'!=',
'and',
'or',
'xor',
'||',
'&&',
'{',
'}',
);
$str2 = array(
'(ح)',
'(ا)',
'(ز)',
'(م)',
'(ع)',
'(ل)',
'(ي)',
'#100#',
'#101#',
'#102#',
'#103#',
'#104#',
'#mcvh#',
'#ZZZ#',
'^>>^',
'~<<~',
'>?":',
'dfd :?>',
);
$out =preg_replace('/|/',NULL,file_get_contents($file)) ;
$out =str_replace($func,$enc,$out ) ;
$out =str_replace($str,$str2,$out) ;
$out =preg_replace('#$([a-zA-Z0-9]+)#',"@$1@",$out) ;
$op=fopen("$file",w);
fwrite($op,$out);
fclose($op);
}
then call :
encode("file path");