PDA

View Full Version : downloading php


Vivi Ornitier
11-26-2002, 02:17 AM
I was just wondering if there was a way to download php files. I mean u can right click on a link and click save target as, but if u do that for php files they just save the html part of the php script. Is there a way to save the raw .php file? The reason i'm asking this is because i was at the library and i uploaded a php file onto my site that wrote out html but then i couldn't save the php file and everytime it saved the html file and i couldn't do what i needed to.

Any answers?? :smoke:

JulianD
11-26-2002, 02:25 AM
Uhmm There's no way to download the PHP file itself... You can write a script to view the source of PHP files. I saw an example of this at www.php.net. See at the bottom of the page, it says, Show sourcecode or something like that.

Erwin
11-26-2002, 07:03 AM
Install my vBFTP hack - it allows you to upload and download PHP files, or any other file you like. ;) You can download PHP files by using the header functions.

Velocd
11-27-2002, 09:43 PM
Erwin, I think he means by simply visiting any site that is coding in PHP, then like viewing the source for it in HTML, you could see the PHP coding.

When saving a PHP file, it doesn't just save the part that is HTML, it saves the output of the PHP script..which is just a bunch of echo functions creating HTML. I would think to download PHP files from websites that use it would be illegal, since you are viewing coded script of somebody else?s work..and could easily be ripped. Viewing HTML source is different in some ways, in that it's created to exactly what that page looks like..although, to be honest I'm not totally sure.

Uh, anyway, I'll conclude since I'm probably drifting off topic. :p

filburt1
11-27-2002, 09:45 PM
There's no way; think about it, you could have the source code for any PHP-based system at will.

Xenon
11-27-2002, 09:52 PM
yes, as filburt said, it's impossible w/o acking into a server ;)

think about s/o downloads your admin/config.php and he'll get acces to your DB...
very huge security hole then....
so it's good it's not possible

NTLDR
11-27-2002, 10:09 PM
You can save files as .phps and then view the source for them too.