Hey guys, So I need to access the source on a PHP file without executing it. Currently, it simply returns an error if you don't user the javascript function that POSTs to the PHP file- Or is there possibly a way to figure out what it's doing through that POST? I don't see why I could do that, but that's why I'm here. It's not a protected file or anything so there's no reason to not be able to download it, I just can't grab it off the server without it executing. Thanks!
Many ways: 1. Login via ftp and download the file. 2. Use PHP with the header() functionality: <?php //the php file you wish to download... $file_name = 'somefile.php'; header('Content-type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file_name)); readfile($file_name); ?> PHP: 3. Via .htaccess (by disabling php), create a .htaccess (if does'nt exist already) within the directory where the .php you wish to download resides and paste the following contents (Notice: It will disable execution of all .php files within that directory theirfore providing access to all your .php files to the public...) php_flag engine off Code (markup):
Sorry, I should have mentioned it's not on my server. My bad! I've already tried grabbing it via PHP, however in reading the file the server executes it and the same error is returned- Same as viewing it via HTML (Firefox or whatnot). Good suggestions though, I appreciate the help!
You just cant get the file if its not your server, just impossible to do so. If anyone could get php files from another server that would be an extremely huge security hole. Short of asking the website owner to give/sell you the file, theres nothing that can be done.
Short answer: Not possible. Long answer: Unless the host has some sort of an issue with rendering PHP files due to a strange setup (rare, but occasional - most often due to an error) it's impossible to download the source of a PHP file. For good reason. The only way to figure out how it's handling a post (without viewing the actual source) is to experiment and try and estimate what kind of checks are being run on it by trying different types of data and seeing what the result is.
Hmmm... Therefore you're asking us to try to clone the scripts or steal that right?? Thats not possible any way sorry!
haha...., i think you want to hack or copying some script...., but its 100.1% not possible...., i am dame sure..
It is not possible to download the PHP file or any server side file from other people's servers through the browser without having ftp access to them. You can view the page source to find any clue about whether that page is part of any standard open source package (e.g wordpress, phpbb forum, etc) so that you can download that package from respective sources.
If you're asking this question then you probably will have a thousand more questions once you get the code haha
You will need to learn hacking for this... or find their ftp password... LOL you reminded me of myself, from my beginner programming days.