Is It Possible To See PHP Files Through A Web Browser?

Profile picture of the author howudoin by howudoin Posted: 10/18/2009
Just wondering, If a site is running using several PHP files, then is it possible to see individual files through a web browser (Using Port 80).

Do I need to install any file for this on my web server or something?

Thanks in advance.
#browser #files #php #web

  • Profile picture of the author ValentinJed
    ValentinJed
    Your browser can't see the source code of PHP files as the web server returns already compiled output from the execution of the script.
  • Profile picture of the author howudoin
    howudoin
    I got it valentin, Simply view the source file of a webpage and you can get an idea about the backend php coding

    Thanks any way!
  • Profile picture of the author KirkMcD
    KirkMcD
    Originally Posted by howudoin View Post

    Simply view the source file of a webpage and you can get an idea about the backend php coding
    No, you can't. You'll learn nothing about the PHP used to build the page by viewing the html source code of the generated page.
  • Profile picture of the author TristanPerry
    TristanPerry
    As above, you can't see *any* of the PHP code. Full stop. Hence it's name:

    PHP: Hypertext Preprocessor

    PHP takes place before anything is sent to the client - i.e. it's a server side language.

    When you "View Source", you are seeing the HTML - which is the client-side code that makes up a web-page.
  • Profile picture of the author howudoin
    howudoin
    No, you can't. You'll learn nothing about the PHP used to build the page by viewing the html source code of the generated page.
    As above, you can't see *any* of the PHP code. Full stop. Hence it's name:

    PHP: Hypertext Preprocessor

    PHP takes place before anything is sent to the client - i.e. it's a server side language.

    When you "View Source", you are seeing the HTML - which is the client-side code that makes up a web-page.
    I just had to figure out the encrypted code in a free footer PHP file of a free wordpress blog, so simply looking at the source html worked fine, for getting rid of the *backlinks*
  • Profile picture of the author bbenson19
    bbenson19
    Yup, it's one of the advantages of Php. It's server source language.
  • Profile picture of the author g705
    g705
    Yes there is no way unless u can download the file with its source
  • Profile picture of the author TamarBoy
    TamarBoy
    The only way it can be done is for the PHP server to be de-registered with the server and if that where to happen, all hell would let loose. so it doesnt happen very often.
  • Profile picture of the author Voon
    Voon
    Well, there is some time when my .htaccess is messed up (during apache upgrade) and my PHP file is no longer execute as PHP but plain text. Then my PHP source is leaked out. =/

    This is a rare, but it's safe most of the time. =)
  • Profile picture of the author TheRichJerksNet
    TheRichJerksNet
    Originally Posted by howudoin View Post

    I just had to figure out the encrypted code in a free footer PHP file of a free wordpress blog, so simply looking at the source html worked fine, for getting rid of the *backlinks*
    So you got a free theme that you did not pay for and you decide that you do not want to give credit where credit is due and remove the link....

    Is that about right ?

    James
  • Profile picture of the author howudoin
    howudoin
    So you got a free theme that you did not pay for and you decide that you do not want to give credit where credit is due and remove the link....

    Is that about right ?

    James
    I'm free to remove the "backlinks" since the same is stated in Terms of Usage of the theme.

    Bhupinder
  • Profile picture of the author phptechie
    phptechie
    As said by others PHP is a server side scripting , it just sends out the HTML response to your browser. So View Page Source will just give you the display part of it (HTML content) & not the application / business logic.

    But if you host the php source files in a server where PHP is not installed or integrated , then the files that you access via browser will just simply display the full code without parsing & you can visually all the php code with html content.

    If you purposely like to allow viewing the source code by your site visitors , then you can place the source code with ".phps" extension & when its viewed in the browser , it displays the code.

    Hope this helps :-)
  • Profile picture of the author farasens1
    farasens1
    No. It is not possible to see PHP files within the brower. You'll see the HTML created by the browser, but nothing more.
  • Profile picture of the author mywebwork
    mywebwork
    Originally Posted by howudoin View Post

    I'm free to remove the "backlinks" since the same is stated in Terms of Usage of the theme.

    Bhupinder
    Its curious that the theme would have an encrypted footer if your Terms or Usage says you are free to remove them What would be the purpose of encrypting them in the first place?

    Not accusing you of anything but I'm confused - as a developer I'd only bother to encrypt something that I didn't want modified.

    Bill

Related discussions