google.com, pub-2879905008558087, DIRECT, f08c47fec0942fa0
  • You have 1 new Private Message Attention Guest, if you are not a member of Urdu Tehzeb, you have 1 new private message waiting, to view it you must fill out this form.
    + Reply to Thread
    + Post New Thread
    Results 1 to 4 of 4

    Thread: Secure your website with JavaScript, NO RIGHT CLICK for Images

    1. #1
      ....You don't need to follow trends to be stylish..... Admin Admin's Avatar
      Join Date
      Apr 2014
      Location
      Dubai , Al Mamzar
      Posts
      8,008
      Threads
      254
      Thanks
      372
      Thanked 294 Times in 242 Posts
      Mentioned
      681 Post(s)
      Tagged
      6427 Thread(s)
      Rep Power
      10

      Secure your website with JavaScript, NO RIGHT CLICK for Images

      Have you ever worked really hard on graphics for your site only to find later that someone has stolen them as their own. You can help encrypt and protect your site with the following HTML codes. No right click block is 100% effective, but they will help against novices.

      Use the script below so when someone right clicks to save an image off your page, a message will come up letting people know that your information is copyrighted.

      This script may not work in all browsers, and is not foolproof. If someone really wants something from your page they can find ways around it, but at least it's a warning to people who want to take your graphics. But it certainly is a great start.

      Copy and paste the following code, and make sure it comes right after your <HEAD> tag:

      <script language=JavaScript> var message="Function Disabled!"; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!docume nt.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") </script>

      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>


      "NO RIGHT CLICK" for Source

      Here is a handy little script which will not only protect your images from right clicking, but your whole page. Remember this only stops some visitors from viewing your source. There are ways around it and if someone really wants to view your source they may find a way. There is another trick below to protect your source code, so keep reading.


      <script language=JavaScript> var message="Function Disabled!"; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!docume nt.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") </script>

      Disable Copy and Paste for greater website security.
      One of the most popular questions I recieve here at Hypergurl is "How do you stop visitors from stealing your webpage information?"
      Below is a little trick that will stop your visitors from copying and pasting your webpage information. Anyone with experience may know a way around this trick. However it will make it hard enough to discourage them and get them moving on to easier targets.
      Add the following html code to your BODY tag:
      Here is how your BODY tag may look once implimented:
      <body bgcolor="#FFFFFF" ondragstart="return false" onselectstart="return false">

      ondragstart="return false" onselectstart="return false"

      Make Your Source Code Vanish.
      Now before I show you this last trick to protect your source, I would like you to first view my source. Just click "View" then choose "Source"
      How did I do that?
      Place your cursor in front of the opening <html> tag and hit your enter button for a while. It will push your source code out of view and this will fool the fools. *smiles*


      Similar Threads:

    2. The Following User Says Thank You to Admin For This Useful Post:

      Moona (02-12-2016)

    3. #2
      Moderator www.urdutehzeb.com/public_htmlClick image for larger version.   Name:	Family-Member-Update.gif  Views:	2  Size:	43.8 KB  ID:	4982
      BDunc's Avatar
      Join Date
      Apr 2014
      Posts
      8,431
      Threads
      678
      Thanks
      298
      Thanked 249 Times in 213 Posts
      Mentioned
      694 Post(s)
      Tagged
      6321 Thread(s)
      Rep Power
      121

      Re: Secure your website with JavaScript, NO RIGHT CLICK for Images

      Awesome


    4. #3
      Vip www.urdutehzeb.com/public_html Moona's Avatar
      Join Date
      Feb 2016
      Location
      Lahore , Pakistan
      Posts
      6,209
      Threads
      0
      Thanks
      7,147
      Thanked 4,115 Times in 4,007 Posts
      Mentioned
      652 Post(s)
      Tagged
      176 Thread(s)
      Rep Power
      16

      Re: Secure your website with JavaScript, NO RIGHT CLICK for Images

      Without Reading
      Informative sharing............


    5. The Following User Says Thank You to Moona For This Useful Post:

      intelligent086 (02-15-2016)

    6. #4
      Administrator Admin intelligent086's Avatar
      Join Date
      May 2014
      Location
      لاہور،پاکستان
      Posts
      38,411
      Threads
      12102
      Thanks
      8,637
      Thanked 6,946 Times in 6,472 Posts
      Mentioned
      4324 Post(s)
      Tagged
      3289 Thread(s)
      Rep Power
      10

      Re: Secure your website with JavaScript, NO RIGHT CLICK for Images






      کہتے ہیں فرشتے کہ دل آویز ہے مومن
      حوروں کو شکایت ہے کم آمیز ہے مومن

    + Reply to Thread
    + Post New Thread

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

    Visitors found this page by searching for:

    Nobody landed on this page from a search engine, yet!
    SEO Blog

    User Tag List

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •