PHP sitelerde sağ tuş ve yazı seçme yasaklanması

Php sitelerde sağ tuş ve yazı seçme yasağı bazen gerekebilir. Bu gibi durumlarda sağ tuş yasağı koymak için aşağıdaki PHP koda ihtiyacımız var. Bu PHP kodu sayesinde sağ tuş yasaklanacak ayrıca kullanıcılar yazıyı seçemeyecekler. Unutmayan ki bu PHP Kodu, sadece PHP sitelerinde geçerlidir.

<SCRIPT language=JavaScript>curPage=1;
document.oncontextmenu = function(){return false}
if(document.layers) {
   window.captureEvents(Event.MOUSEDOWN);
   window.onmousedown = function(e){
      if(e.target==document)return false;
   }
}
else {
   document.onmousedown = function(){return false}
}</SCRIPT>
<script language="JavaScript1.2"> 

//Disable select-text script (IE4+, NS6+)- By Andy Scott
//Exclusive permission granted to Dynamic Drive to feature script

function disableselect(e){
return false
} 

function reEnable(){
return true
} 

//if IE4+
document.onselectstart=new Function ("return false") 

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>