Will users of my site be able to see the content of a .php file?

Discussion in 'PHP' started by Tintumol, Jan 26, 2011.

  1. #1
    I wanted to make a feedback form for my website and know nothing of PHP so I decided to try an automatically generated one at thesitewizard dot com. But when I test out the page locally it shows me the .php file which has sensitive information in it (email, reCAPTCHA private key) instead of thankyou.html. This is how the HTML links to the php file:
    <form action="feedback.php" method="post">[...]</form>

    The php file and feedback.html (which contains the feedback form) are both located in the base directory. So will pepole be able to see the contents of the php file if I upload it to a host? Sorry guys, I'm completely new to PHP.
     
    Tintumol, Jan 26, 2011 IP
  2. CPAPubMichael

    CPAPubMichael Peon

    Messages:
    231
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The answer is no, people will not be able to see any PHP scripting on your website. They can only see the HTML/CSS, JavaScript, jQuery and AJAX.

    Thanks,

    Michael
     
    CPAPubMichael, Jan 26, 2011 IP
  3. Falrish

    Falrish Greenhorn

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #3
    PHP is a server side scripting language. They will not be able to see the code unless the gain root access into your server.
     
    Falrish, Jan 26, 2011 IP
  4. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #4
    they'r not able, this problem is probably because you closed ?> php tag in wrong time
     
    G3n3s!s, Jan 26, 2011 IP
  5. tomelliott

    tomelliott Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you PHP is set to output (echo) any HTML then the resulting HTML only will be displayed... however, sounds an obvious one, but make sure your host supports or has PHP enabled... some windows servers\setups will output the php file as if you were viewing it in notepad rather than processing it.
     
    tomelliott, Jan 26, 2011 IP
  6. Raymond_M

    Raymond_M Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If it isn't currently uploaded to a host and your checking it on your computer it will not support php without installation of a server on your computer such as WAMP. If after it is uploaded to your host, then it should work as normal, unless your host either doesn't support it, or has an error in the code something like the others stated before me.
     
    Raymond_M, Jan 26, 2011 IP
  7. Backlinkshub

    Backlinkshub Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    php code will not be seen by your clients.


    They can only see HTNL cone in place php code.
     
    Backlinkshub, Jan 26, 2011 IP
  8. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #8
    I am not getting why are you replying with same answer than much buddies before.
     
    G3n3s!s, Jan 27, 2011 IP
  9. ashok221187

    ashok221187 Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    for sure they will not be able to see them unless they obtain the access by some means...
     
    ashok221187, Jan 27, 2011 IP
  10. srisen2

    srisen2 Peon

    Messages:
    359
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    if you close your ?> and continue the php code it will be displayed as html in which case if would be shown. Other wise you must place all code you wish to display to the user within an echo "display code here " statement. This code is then rendered as standard html and JavaScript by the browser.
     
    srisen2, Jan 27, 2011 IP
  11. chanif.alfath

    chanif.alfath Active Member

    Messages:
    148
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    88
    #11
    of course not, because php is a programming on the server side, so that clients can not see the php script, which they could see only on the client side programming like HTML and CSS, and JavaScript as well. :D
     
    chanif.alfath, Jan 28, 2011 IP