How do I prevent web page download?

Discussion in 'PHP' started by alimoses, Jan 11, 2011.

  1. #1
    Can someone please tell me how to prevent my web page from being downloaded?
     
    alimoses, Jan 11, 2011 IP
  2. sabato

    sabato Member

    Messages:
    407
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    43
    #2
    hi,
    stop publish it :) thats the only way. Html that server sends to the browser can be downloaded. Thats how it works
     
    sabato, Jan 11, 2011 IP
  3. krishmk

    krishmk Well-Known Member

    Messages:
    1,376
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    185
    #3
    Could you be more specific as to what you want to achieve?
    Becoz anything that you show to your visitors over the browser - the source code (html) can be viewed. There are some encrypting techniques as well but the same could be decrypted..

    Try password protecting the web page by granting access only to visitors who are allowed to view the web page in context.
    If this is for a "file" like word document, pdf or video you could store the file outside your web tree and use php for retrieval/download.
     
    krishmk, Jan 11, 2011 IP
  4. BW1

    BW1 Well-Known Member

    Messages:
    252
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #4
    perhaps php isnt setup properly and also check your file permissions
     
    BW1, Jan 11, 2011 IP
  5. mario212

    mario212 Peon

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you use php,put php code in pages with .php extension.Html source code must be visible for search engines.
     
    mario212, Jan 11, 2011 IP
  6. seafrontsteve

    seafrontsteve Peon

    Messages:
    451
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Anything anybody can see online can be copied.
    All you can do is make it a little more difficult to do.
    One very easy change is to prevent the use of right clicks to copy and save.
    You can do this by changing your html <body> tag to <body oncontextmenu="return false;">
     
    seafrontsteve, Jan 11, 2011 IP
  7. tacopalypse

    tacopalypse Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    php files can't be downloaded.
    only their outputted html can be seen.
    if you're trying to prevent html files from being downloaded, there's a few tools out there that let you hide your html code.
    can't think of any off the top of my head, but try googling for them.
     
    tacopalypse, Jan 11, 2011 IP
  8. loog12us

    loog12us Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    any server side script can not be downloaded unlike client side , are you trying prevent peoples form downloading your streams?
     
    loog12us, Jan 13, 2011 IP
  9. ankit_frenz

    ankit_frenz Active Member

    Messages:
    1,111
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    63
    #9
    do you mean prevent page from being downloaded or file from being downloaded? if its file there are dozens of way to do it.if its page i guess hardly anything can be done.Please be more clear and specific so that we can help you out!!
    Thanks
     
    ankit_frenz, Jan 13, 2011 IP