Results 1 to 9 of 9

Thread: Source help needed

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    13

    Source help needed

    i've seen some sites, which don't allow you to view their source code, i wanna stop people viewing my source code, how can i do that, do you need some sort of a code, please help.....
    Welcome Yousefj32uk

  2. #2
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    There are ways to disable right click or button on keyboard that is equivelant to a right click, but to prevent someone from seeing your source is impossible. (I think)

    They could always use the "view source" option in the web browser to view your source.
    They could also use a packet sniffer to grab your source... not to mention a web site/page copier....

    Here is a link to the code to disable right click.
    You can modify the source to display whatever message you want to. Many unsavy computer users will be fooled... but it won't fool people with half a brain....

    I have tested that the right click is disabled in IE6sp1 and Netscape 7 and Mozilla 1.0.2
    I don't have any other browsers on this machine to test it on...

    Maybe someone else has a better solution for you...
    I'm not all that experienced with web site development... or site security...
    I can just do the basic stuff. We have several people here that could explain it better than I.

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    As far as I know you can't actually disable the viewing of source code... your browser has to see the source of the page in order to display it properly. You can disable right click to view source code with the following javascript

    Code:
    <script language="JavaScript">
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this  header
    // Set the message for the alert box
    am = "Copyright 2002";
    // do not edit below this line
    // ===========================
    bV  = parseInt(navigator.appVersion)
    bNS = navigator.appName=="Netscape"
    bIE = navigator.appName=="Microsoft Internet Explorer"
    function nrc(e) {
       if (bNS && e.which > 1){
          alert(am)
          return false
       } else if (bIE && (event.button >1)) {
         alert(am)
         return false;
       }
    }
    document.onmousedown = nrc;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    if (bNS && bV<5) window.onmousedown = nrc;
    </script>
    One option is to encrypt your site using javascript text encryption. It'll make it a real pain in the ass for people to decrypt if they wish to view your code....

    There are programs available for this.... I'm afraid i don't know of any freeware/open source programs, but i'm sure you could search for one. Here's an example of a commercial program, Source Encryption

    I hope this helps you out...

    [EDIT]
    Looks Like I was typing this out at the same time as you phishphreek80
    [/EDIT]

  4. #4
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    After using "no right click" tags and "fullscreen" tags to try hiding my source codes, I have come to the conclusion that the people you are successfully hiding it from dont even know what a source code is. Bottom line, if they want it, they have it, everytime they open your pages. You could use a dazzling array of frames to confuse them and make uncanny page names, but in the end, they'll still have it. HTRegz said it best, encrypt it and make em work for it.
    [shadow]Who cares if it works, I just want to know WHY![/shadow]

  5. #5
    Junior Member
    Join Date
    Mar 2002
    Posts
    13
    there are some site, where if u view the source code it comes up blank, and some, of them u can't even click the "view source" button on the browser, i dn't know how they do it, does anyone know, your help will be appreciated!
    Welcome Yousefj32uk

  6. #6
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Could you possibly give us an example of these sites? Post a URL or two.. then maybe we'll be able to give you more information.

  7. #7
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    They are tricking you into believing there is no source code byleaving enough lines black at the top you dont realize you need to scroll down, you only see a blank page. As for the menu being removed, it is accomplished by Jacascript tags. You can get these free at many javascript sites. I have tried a completely fullscreen viewing with a "exit" button added for the viewer to close out the screen. This works good, but nosey people like me get intrigued as to the "how" part and you could attract more attention than before. Unless you are using state of the art tags, or keep something very important in your source, you might want to rethink putting so much time into your source hiding capabilities. http://javascript.internet.com/ has a large supply of tags for every conceivable use, I suggest browsing them for some ideas on how far you want to go.
    [shadow]Who cares if it works, I just want to know WHY![/shadow]

  8. #8
    Junior Member
    Join Date
    Mar 2002
    Posts
    13
    no actually one site i remember going to, didn't have a source code at all, there was nothing their!
    Welcome Yousefj32uk

  9. #9
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    Find it and post it please, I'm curious >grins<
    [shadow]Who cares if it works, I just want to know WHY![/shadow]

Posting Permissions

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