Discussion in 'General Programming Chat' started by Hubert115, Jul 26, 2012.
Can someone tell me how I can figure out if a website is coded in HTML or PHP?
Well look in the address bar. Does it say index.html or index.php? If it just says the URL, add index.html to the end of the URL and if you do not get a 504 it is HTML, otherwise it is php.
So this site is PHP? Because i did blackhatworld.com/index.html and it gave a 404 error
And some of them it just gives me an error not a 504 or 404 error... like fileice.net/index.html just says this page doesnt exist...
do a whois lookup to find out what kinds of servers it's running
do a google search with the url + php in google
Yes. Here's my somewhat lame explanation (I'm unqualifed, thus might bodge this):
HTML = static content. (Think: simplicity)
PHP = scripting language. That can produce HTML as an output due depending on certain factors.
U can't now. Honestly. If is simple without some special functions it is html and if is not, it's php. You can do all kind off staff with htaccess and extensions.
Actually, you can use php to create a page in html on the fly.
Php is executed on the server side, you will never see it.
Html is executed client side, that part you see but there is no way of knowing how it was created.
Anything executed on the client side, can be seen, tracked and recorded by you.
But just to be clear, I can write a page in html and just put in the php script code where needed without you ever seeing it. As long as the server has php installed, it will work.
damnit... I really needed a way to do this.
There's no guaranteed way. You can make .html pages with php. The first thing to look at is it .html or .php. If its .html is the content possibly non-static enough to require php? Second is to look at the page headers; see if there is an x-powered-by with PHP there. Not all servers support/send that header though so it can't be relied on. Third is to check the footprint to see if its a specific app.
I was just thinking on it a bit more and if the site has a login it uses php unless the owner needs some serious slapping. That might be another way of telling.
You can have a login without cookies, but without php to check any login request you might as well not have it at all.
ANY site is HTML (or XHTML which is a variant)
PHP is a server side programming language, so it does some stuff and eventually outputs HTML. Same with any other programming language that is used to generate a web page.
There are many, many ways to figure out if a site is static HTML or uses a programming language, and which language and writing an exhaustive list of methods would take a long time. However think of it like this - if it has a form anywhere it needs a programming language to handle the submit.
Easiest way, which may not always work is to enter index.php after the domain - e.g. http://x.com/index.php if it loads then it uses PHP. But keep in mind that just because a site uses PHP doesn't mean it uses just PHP or that it uses it on every page.
The html(variant) can be generated by pretty much any programming language or scripting language. including php asp .net and many languages you wouldn't expect. How it is created is as relevant as whether they are using a flatfile to store data or a database(and what kind of database).
I guess for anyone to help you out we need to know 'why' you need to know what the site is running on.
Do NOT go by the file extension. .html and .htm cam both be php generated pages. All you have to do is set the htaccess to parse html and htm files for php code.
Many sites that I have built, started out using static html and later php elements where added. So it was much easier to just tell the server to parse the html files for php.
Also html pages can look like they have php created elements. But, those elements could be server side includes (SSI) and not php.
For example, just looking at the html tag of this site shows a popular forum software name called vbulletin. The vbulletin wiki says it uses php and mysql. Not to say that this is definitely the language and db uses, but it's pretty likely. You just gotta look for clues that the developer may have left behind.
But I guess the real question is...why do you want to know?
um.......maybe just look at the source
Looking at the source is a way to determine this but you can not really be sure if the website is using PHP or pure HTML.
HTML is the compiled code of the scripting language of PHP, .NET or others.
For instance if I want to troll someone I can simply make the compiled HTML as the source code of a Wordpress website even if I do not use PHP.
There is a website, http://builtwith.com/, they seem to be pretty good at figuring it out. Even if the .htaccess file has been modified.
What are the file extensions of your web page? .html or .php? That will tell you.
That will not tell you!
PHP is serverside, usually when used to generate a web page it will output HTML etc...
If you wanted you could display .bhw as your file extension.
Separate names with a comma.