How to view the source of a PHP file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fadili
    New Member
    • Mar 2010
    • 6

    How to view the source of a PHP file

    Can someone tell me how to view the source of a PHP file. Or how to find a .txt/.jpeg/ (any) file in a host.
    If you must now more information, don't hesitate to ask.
    Last edited by Fadili; Mar 7 '10, 01:53 PM. Reason: Added some text
  • guillermobytes
    New Member
    • Jan 2010
    • 77

    #2
    it depends on your host's operating system. if it is unix:
    -see php source:
    Code:
    gedit /path/to/your/php/file.php
    -find any file with defined end like for example .txt:
    find DIRECOTRY -name "*.FILETYPE " -print
    Code:
    find . -name "*.txt" -print

    Comment

    • Fadili
      New Member
      • Mar 2010
      • 6

      #3
      Hi guillermobytes
      Thanks for replying, hmm ... i'm sorry for my simplicity, but the php file is not in my host, ok that's the problem, someone wanted to scam me (phishing), but i didn't send him my pass'es, so i wanna now were is the .txt file, where are saved the passwords, to prevent the others, and report it as a scam.

      I've founded a file - write.php - maybe it can help you.
      Thanks

      Fadili

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        On a properly configured server, you can not read the actual PHP code. All you can do is get the output it generates.

        Comment

        • philipwayne
          New Member
          • Mar 2010
          • 50

          #5
          Or you could use the built in show_source function, you know which ever is easier =].



          EDIT:

          I assume you meant to display your own source code.

          Comment

          Working...