www.webdeveloper.com
Results 1 to 6 of 6

Thread: View source ( declined )

  1. #1
    Join Date
    Jul 2012
    Posts
    29

    View source ( declined )

    How can you actualy stop someone from viewing your source code

    i have a page i would like to block the source code its something people will

    want to cut and paste - i want it be unique to the website

    ie < you are not permitted to view this information > or the website declined

    to show this infornation

    ive read it cant actualy be done

  2. #2
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    From what I know, reading the source code of the page is a functionality of the browser. A code in the page cannot block this functionality.

  3. #3
    Join Date
    Jan 2004
    Location
    chertsey, a small town s.w. of london, england.
    Posts
    1,478
    Hi there jase,
    How can you actually stop someone from viewing your source code
    If you have to ask this question, then you may rest assured that there is
    absolutely no code in your website that anyone will want to use.

    You are just experiencing a mild attack of paranoia.

    Certain mind bending drugs may produce this state as a side effect.

    coothead

  4. #4
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,434

    Exclamation

    Quote Originally Posted by jase View Post
    How can you actualy stop someone from viewing your source code

    ...

    ive read it cant actualy be done
    You read correctly even if you cannot capitalize or punctuate.

  5. #5
    Join Date
    Jun 2012
    Location
    FL, USA
    Posts
    48
    Not that I know of -- but I do know that server-side code doesn't get rendered in the browser source code...directly

    like PHP, ASP and the others.

    e.g.

    Code:
    <?php //you will never see me in 'view source'!!! ?>
    but with
    Code:
    <?php print "<p>hello</p>"; ?>
    this will indeed be in the source:
    Code:
    <p>hello</p>

  6. #6
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    just make the code ugly (obfuscated+minimized), and it won't get stolen. to prevent someone from simply pasting the garbled mess, you can hide something in the code that checks to make sure what site the script is running from.

    while technically you cannot hide client code, you practically can in the world of dumb and lazy coders who want quick cut-and-paste solutions.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles