Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2012
    Posts
    21

    Need PHP script for this

    Friends,can i have some help?
    i need 2 php scripts:
    1. one that disables right click
    2. second that when open the source it shows NOTHING or something that i want

  2. #2
    Join Date
    Sep 2012
    Posts
    21
    Pls. someone share for this question...its really need for me

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    12,447
    You cannot disable right click in classic, web based PHP. you may be able to do that in command line/batch PHP though

    what you might be able to do is use Javascript to inhibit the right click methods used buy the browser, however Im not really up to speed on Javascript so I don't know if that will meet your requirements

    econd that when open the source it shows NOTHING or something that i want
    sorry I haven't got a clue what you are trying to do, or what you are struggling with here.
    within PHP you can test for the existence of resources and take appropriate action. I think that test only wokrs on local resources (IE you can test if an image in on the same physcial server, but you cannot test if a remote resources is present, that may well have changed with subsequent releases of PHP)

    hgowever I suspect you coudl test if resources are found using javascript.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,004
    He wants to prevent a user from viewing his php code by clicking on "view source" in the browser.

  5. #5
    Join Date
    Sep 2012
    Posts
    21
    Ok i agree with your answer..i ll change that

  6. #6
    Join Date
    Jan 2012
    Posts
    19
    i understand what he is saying... he wants to wrote some lines like anything...

    sdfasdf
    adf
    adf
    ad

    and he wants nobody can right click on his page...

    this happen using adding javascript code google it javascript right click disable

    and another one is that

    when a person view his source the page only display some header tags and hide the content in the source so nobody copy the content of his page...

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,100
    PHP is a server side language. Right-click events are on the client side.

    Therefore PHP cannot be used to disable the right-click.

    Furthermore; when a user views the source of the page: no PHP code is shown, only the resultant HTML that is produced and sent to the browser.

    Why do you want to perform these actions anyway?
    George
    Home | Blog

Posting Permissions

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