How to download a php file

Discussion in 'Site & Server Administration' started by HighRankingSEO, Aug 17, 2009.

Thread Status:
Not open for further replies.
  1. #1
    Hey,

    I found a really cool script on a guys site, and it got me to thinking...even though PHP is server side so you wouldnt be able to view source or anything...is there any way you could just downloadtheir PHP script or what?
     
    HighRankingSEO, Aug 17, 2009 IP
  2. vagrant

    vagrant Peon

    Messages:
    2,284
    Likes Received:
    181
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not unless you have direct access to their server files as far as i know, otherwise it would become a big security risk.

    PHP files "run" on the web server then output the page as html code to your browser so you only see it's output.

    Best you can do is try to find the scripts name and see if it is available, as the site to see you the script if it is their won, or get someone to make you one that does the same thing.

    If you post the url of the site, someone here may know what it is or how to do the same thing.
     
    vagrant, Aug 17, 2009 IP
  3. HighRankingSEO

    HighRankingSEO Well-Known Member

    Messages:
    423
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    125
    #3
    yea, I know the name of the file and everything, tried every way possible ....just didnt know if someone knew of a way to just download it without rendering...after all, it is a file...just thought maybe there was a chance, no biggie. Thanks anyway
     
    HighRankingSEO, Aug 17, 2009 IP
  4. ct2k7

    ct2k7 Peon

    Messages:
    457
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The file is compiled and generated on the server before being transfered as hypertext.
     
    ct2k7, Aug 17, 2009 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    PHP will only output html you cant get the codes . but u can hire a person who can create a clone
     
    Bohra, Aug 18, 2009 IP
  6. Guttu

    Guttu Peon

    Messages:
    728
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You need to look into javascripts in the page. That may be the one for the effect. PHP files normally don't do the effects.
     
    Guttu, Aug 18, 2009 IP
  7. HighRankingSEO

    HighRankingSEO Well-Known Member

    Messages:
    423
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    125
    #7
    I think everyone misunderstood me....
    Without Options - Indexes in your htaccess someone can pretty much jack anything they want by viewing the directory of files....SO, CAN you download a PHP script without the server parsing the PHP and compiling the html? I understand how PHP works and that wasn't really what I was asking...I just wanted to know if it is possible to download a PHP file from an unprotected directory.
     
    HighRankingSEO, Aug 19, 2009 IP
  8. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Well yes, if PHP is somehow disabled on the server it will output just as regular text. I believe this has happened to facebook once before and some people were able to grab a couple of pages. That's why it's best to use a front controller pattern:

    Only have 1 index.php file that handles all requests:

    index.php?module=bla loads public_html/../modules/bla.php etc

    So those php files are outside the document root and can never be viewed should such an unfortunate apache error occur (this could happen after a faulty apache/php upgrade, for example)
     
    premiumscripts, Aug 19, 2009 IP
  9. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #9
    It's doable but gets into the hacking discussion that's against the rules of the forum here.

    Please think of it this way. Most folks have scripts where their username, password, and database information is contained within a php file. If that was downloadable, one could have complete access to your hosting account. Or at least MySQL.
     
    theapparatus, Aug 19, 2009 IP
Thread Status:
Not open for further replies.