Download php code from a site without executing it.

Discussion in 'HTML & Website Design' started by Xitanto, Sep 4, 2006.

  1. #1
    I'm trying to download the code for a PHP file, but every time I open it it tries to execute and gives me a blank page with no code.

    Is there any way to download a complete php file without executing it?

    I.e. if I wanted to download an index.php with all the < ?php tags in place.

    =| I'm afraid there's no copy of this left around as it contains hacked code from a CMS.
     
    Xitanto, Sep 4, 2006 IP
  2. maney

    maney Active Member

    Messages:
    1,130
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Go to the page on the internet, right click it, select view source (or view page source) and the code for the page will be presented. Copy and paste it into a blank document and save it as a php file.
     
    maney, Sep 4, 2006 IP
  3. KC TAN

    KC TAN Well-Known Member

    Messages:
    4,792
    Likes Received:
    353
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Hi Xitanto, I'm afraid its not possible unless the server has a misconfiguration..
     
    KC TAN, Sep 4, 2006 IP
  4. woodside

    woodside Peon

    Messages:
    182
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    KC TAN is correct. You'll need access to the server (ssh, ftp etc.) to be able to view the source. The only way you'd see the source with a browser is if the webserver isn't working right and not processing the php code before sending out the page.
     
    woodside, Sep 4, 2006 IP
  5. rosytoes

    rosytoes Peon

    Messages:
    230
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If this is possible then everyone will be stealing everyone else's codes:) If it is your site, then can't you just get it via ftp?
     
    rosytoes, Sep 4, 2006 IP
  6. vic_msn

    vic_msn Well-Known Member

    Messages:
    2,233
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    155
    #6
    php codes do not apper in the source of a live page. it only contains executed html codes.
     
    vic_msn, Sep 4, 2006 IP