How to view actual code of a .php page on the internet?

Discussion in 'PHP' started by livingfree, Oct 4, 2008.

  1. #1
    How can I view the contents of a .php on the internet to see the actual code.

    I am trying to see the code but when I open the page or choose to save it just gives an error on line ... blah blah blah or a blank page.
     
    livingfree, Oct 4, 2008 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,930
    Likes Received:
    4,563
    Best Answers:
    124
    Trophy Points:
    665
    #2
    You can't - the php page is processed and it's output (usually html or xml) is sent to your browser.

    there is a command highlight_file which can be used to format a php file for reading but you need to have a script on the server to use it.
     
    sarahk, Oct 4, 2008 IP
  3. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You are newbie to the programs .
    All the php code are executed at the server side before sending to browser.
    You can't view the php code but the html code.
     
    justinlorder, Oct 4, 2008 IP
  4. livingfree

    livingfree Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for responding.

    So you can't save it or download or anything either to look at it offline?
     
    livingfree, Oct 4, 2008 IP
  5. mehdi

    mehdi Peon

    Messages:
    258
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes, the PHP pages are server sided.. you cannot save or download it, if you have Server access then you may connect that server by FTP and download the PHP page you want.

    Thanks
     
    mehdi, Oct 4, 2008 IP
  6. livingfree

    livingfree Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks for your help guys .. I was hoping to learn from something but never mind.
     
    livingfree, Oct 4, 2008 IP
  7. livingfree

    livingfree Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    wow! I make one post and I've been swamped with private SPAM messages. Thanks but no thanks .. I've switched em off.
     
    livingfree, Oct 4, 2008 IP
  8. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #8
    You can make your extensions .phps which are viewable.

    Peace,
     
    Barti1987, Oct 4, 2008 IP
  9. livingfree

    livingfree Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks azizny it's not my file. I was trying to learn from a .php file I found on the internet.
     
    livingfree, Oct 4, 2008 IP
  10. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If people could view our PHP files, all hell would break loose! All someone would need to do to get access to your database would be to open your config.php and look at the settings. Now you can see why the php isn't viewable, only it's output.

    To learn php, check out some tutorials and open source code instead, that will help you more.
     
    garrettheel, Oct 4, 2008 IP
  11. darkmessiah

    darkmessiah Peon

    Messages:
    500
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #11
    once you finally figure this all out, you'll understand why you can't do what you want to do. Considering people put database usernames and passwords in php files, exposing this type of information you be lethal to any internet business.

     
    darkmessiah, Oct 5, 2008 IP
  12. bm_ys

    bm_ys Well-Known Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    #12
    You can't get php code of web site, server processes the php page and genarate a html from it and outputs it to send browser.
     
    bm_ys, Oct 5, 2008 IP