How Can I Hide My Source Code

Asked By 50 points N/A Posted on -
qa-featured

I want to be able to hide my source code so other developers won't be able to see what I have done with my website.

Is there a code to prevent other people from viewing my source code?

Is JavaScript encryption a way to hide my source code?

SHARE
Best Answer by fahadsohail
Answered By 15 points N/A #107833

How Can I Hide My Source Code

qa-featured

Hi

You can make secure your website resource by use some technique. Every web developer wants to make secure their coding. You can use too PHP function in your website for make your code invisible. Because PHP script is a dynamic resource which is invisible even the output of PHP is always visible to all. We can get the result of PHP only but the exact code work virtually in server by stay invisible.

You can use JavaScript to disallow copy – paste in your site. So people can not copy your web content. Maximum web developers are use this JavaScript for keep site unique.

Thanks

Best Answer
Best Answer
Answered By 0 points N/A #107834

How Can I Hide My Source Code

qa-featured

Yeah in javaScript you can easily Disable Right Click Option Solution Also Use Javascript For Your Security Or For your Code Because Is Very Esay to use And Here Is Your Code .you can try on and also u can copy paste this code this will help you in future.

 
Solution 1.
 
This Code will Help you To Protect Your Code 
<SCRIPT TYPE="text/javascript"> 
<!– 
//Disable right click script 
var message="Sorry, right-click has been disabled"; 
/////////////////////////////////// 
function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
document.oncontextmenu=new Function("return false") 
// –> 
</SCRIPT> 
 
2.Solution 
 
If you don’t like using javascript, you can always use a span tag to position a transparent gif over the top of the image like the example code below. Don't forget, you will need to create a transparent.gif to implement this method.
<span style="background-image: url(images/my_image.jpg)"><img src="images/transparent.gif" width="200" height="150" border="0" alt="Protected Image."></span>
 

Related Questions