สำหรับ Code ตัวนี้เป็น HTML นะครับโดยใช้ JAVA SCRIPTเพื่อเข้ารหัส CODE HTML ที่เพือนๆไม่ต้องการให้มีใครมา View Code คัดลอกเอาไปใช้ไงลองคัดลอกเอาไปใช้ดูเด้อ
<BODY bgColor=#ffffff onload=initStyleElements() marginwidth="0">
<STYLE>.tablinks A {
COLOR: blue
}
.tablinks A:visited {
COLOR: blue
}
.tablinks A:hover {
COLOR: brown
}
</STYLE>
<!--aspthml bot="HTMLMarkup" startspan -->
<SCRIPT language=JavaScript>
<!--
//////////////////////////////////////////////////////////////////
// Source Code Encrypter v1.0 //
//////////////////////////////////////////////////////////////////
var i=0;
var ie=(document.all)?1:0;
var ns=(document.layers)?1:0;
function initStyleElements() /* Styles for Buttons Init */
{
var c = document.pad;
if (ie)
{
//c.text.style.backgroundColor="#DDDDDD";
c.compileIt.style.backgroundColor="#C0C0A8";
c.compileIt.style.cursor="hand";
c.select.style.backgroundColor="#C0C0A8";
c.select.style.cursor="hand";
c.view.style.backgroundColor="#C0C0A8";
c.view.style.cursor="hand";
c.retur.style.backgroundColor="#C0C0A8";
c.retur.style.cursor="hand";
c.clear.style.backgroundColor="#C0C0A8";
c.clear.style.cursor="hand";
}
else return;
}
/* Buttons Enlightment of "Compilation" panel */
function LightOn(what)
{
if (ie) what.style.backgroundColor = '#E0E0D0';
else return;
}
function FocusOn(what)
{
if (ie) what.style.backgroundColor = '#EBEBEB';
else return;
}
function LightOut(what)
{
if (ie) what.style.backgroundColor = '#C0C0A8';
else return;
}
function FocusOff(what)
{
if (ie) what.style.backgroundColor = '#DDDDDD';
else return;
}
/* Buttons Enlightment of "Compilation" panel */
function generate() /* Generation of "Compilation" */
{
code = document.pad.text.value;
if (code)
{
document.pad.text.value='Compiling...Please wait!';
setTimeout("compile()",1000);
}
else alert('First enter something to compile and then press CompileIt')
}
function compile() /* The "Compilation" */
{
document.pad.text.value='';
compilation=escape(code);
document.pad.text.value="<script>\n<!--\ndocument.write(unescape(\""+compilation+"\"));\n//-->\n<\/script>";
i++;
if (i=1) alert("Page compiled 1 time!");
else alert("Page compiled "+i+" times!");
}
function selectCode() /* Selecting "Compilation" for Copying */
{
if(document.pad.text.value.length>0)
{
document.pad.text.focus();
document.pad.text.select();
}
else alert('Nothing for be selected!')
}
function preview() /* Preview for the "Compilation" */
{
if(document.pad.text.value.length>0)
{
pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,width=700,height=320,left=50,top=110");
pr.document.write(document.pad.text.value);
}
else alert('Nothing for be previewed!')
}
function uncompile() /* Decompiling a "Compilation" */
{
if (document.pad.text.value.length>0)
{
source=unescape(document.pad.text.value);
document.pad.text.value=""+source+"";
}
else alert('You need compiled code to uncompile it!')
}
// -->
</SCRIPT>
<center>
<TABLE cellSpacing=0 cellPadding=0 width="770" border=0>
<TBODY>
<TR>
<TD width="100%" align="center" class="text">
ASPThai.Net Encrypt Code HTMLใส่ Code HTML ที่ต้องการป้องกันไม่ให้ใครคัดลอก ลงในช่องด้านล่าง
และกด Encrypt เพื่อเข้ารหัส และรอสักครู่ จนเข้ารหัสเสร็จ จากนั้นกด Preview เพื่อดูผลลัพธ์
<!-- Compilation Panel -->
<FORM name=pad method=post align="center">
<TEXTAREA style="WIDTH: 95%; BACKGROUND-COLOR: #ebebeb" name=text rows=11 cols=58></TEXTAREA>
<BR>
<INPUT onmouseover=LightOn(this) onclick=generate() onmouseout=LightOut(this) type=button value=Encrypt name=compileIt>
<INPUT onmouseover=LightOn(this) onclick=selectCode() onmouseout=LightOut(this) type=button value=Select name=select>
<INPUT onmouseover=LightOn(this) onclick=preview() onmouseout=LightOut(this) type=button value=Preview name=view>
<INPUT onmouseover=LightOn(this) onclick=uncompile() onmouseout=LightOut(this) type=button value=Source name=retur>
<INPUT onmouseover=LightOn(this) onmouseout=LightOut(this) type=reset value=Clear name=clear>
</FORM>
<!-- Compilation Panel -->
</TD>
</TR>
</TBODY>
</TABLE>
<!--aspthal bot="HTMLMarkup" endspan -->
ปล. ผมลองรันดูแล้วใช้งานได้ดีมากมายครับ
ที่มา :
http://smf.na-man.com/index.php?topic=231.msg444#msg444