SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    England
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do I display the actual code of a php page?

    I looked at source.php on php.net's source viewer. I didn't quite understand it and didn't know what exactly was outputting the data.

    What are the functions or calls that will display the source of a page?

  2. #2
    SitePoint Enthusiast HogMan's Avatar
    Join Date
    Mar 2003
    Location
    Nebraska
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by N9ne
    I looked at source.php on php.net's source viewer. I didn't quite understand it and didn't know what exactly was outputting the data.

    What are the functions or calls that will display the source of a page?
    Depending on what you are trying to do, you can just make a copy of your php script and give it a .phps extention which will display the source code for the page.

  3. #3
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    England
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really? I didn't know that having .phps will do that! Thanks.

    Question: what is the application handler type thing for .phps?

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be application/x-httpd-php-source.

  5. #5
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    England
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, thanks for the help

  6. #6
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your talking about wanting to look at the php code behind a site thats powering it, you really can't unless you know the exact name of the files, then you can make links to them and do 'save as'.

  7. #7
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Archbob
    If your talking about wanting to look at the php code behind a site thats powering it, you really can't unless you know the exact name of the files, then you can make links to them and do 'save as'.
    Uh, no you can't. That will just save the html results.

    Think about it, If that would work than every site running php-nuke, phpbb, & any php project would be compromised.

    Otherwise something like this would work: http://www.sitepointforums.com/config.php

    Then I'd have your db username/password.
    You smell something?


Bookmarks

Posting Permissions

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