-5

I came across a website and liked its look. So, I wanted to know how its style.css is coded. I got there style.css file by visiting to Network Tab of Inspect Element and then opening that file in a new tab. We can open JS files also in the same way.

But, how can I open a PHP file? I know the directory where the PHP file of that website is located, but when I type that directory in the browser's address, it shows a blank page (full white blank page with nothing on screen), so I thought I need PHP installed on localhost.

So, alternatively, to get the PHP file, I downloaded that file and opened it in Sublime Editor, but there too, it shows blank.

So, how can I get that PHP file?

[Note: This is just a question for educational purposes. This thought suddenly came in my mind when I was going through that CSS file and just for the sake of my anxiety and knowledge, I'm asking this question. No offense or criminal minded tendency..]

Paras Shah
  • 105
  • 11

1 Answers1

6

It´s not possible. PHP files are executed on server side and can´t be downloaded like HTML files.

More information on this can be found here:

StackOverflow: Can a client view server-side PHP source code?

Can someone steal my PHP script without hacking server?

security.stackexchange.com: Is it possible for a hacker to download a php file without executing it first?

flomei
  • 860
  • 1
  • 11
  • 36
  • Thanks for all those resources along with your answers. That completely cleared my doubt. But, I still don't understand how the guys out on the net get the nulled copies of the protected themes and plugins from Envato Market? – Paras Shah Jun 03 '15 at 10:19
  • Well, either through misconfigured servers but more probably through hacked websites which could then be accessed via FTP or whatever you like. – flomei Jun 03 '15 at 10:55
  • You've a point there. But, almost each and every Themeforest theme's nulled version are out there. So, how it is possible to hack each and every theme developer's website? Or is, themeforest's website hacked via FTP? – Paras Shah Jun 04 '15 at 05:55
  • I really never had a look out for something like that, but maybe those are just some traps to lure people into installing those themes which then drop an error but steal access data on the backside or sth. like that. – flomei Jun 04 '15 at 23:00