1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can i tell if a website is HTML or PHP?

Discussion in 'General Programming Chat' started by Hubert115, Jul 26, 2012.

Thread Status:
Not open for further replies.
  1. Hubert115

    Hubert115 Regular Member

    Joined:
    Jan 26, 2012
    Messages:
    488
    Likes Received:
    16
    Can someone tell me how I can figure out if a website is coded in HTML or PHP?
     
  2. -ReX-

    -ReX- Power Member

    Joined:
    Apr 26, 2012
    Messages:
    707
    Likes Received:
    274
    Location:
    Manly, Australia
    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.
     
  3. Hubert115

    Hubert115 Regular Member

    Joined:
    Jan 26, 2012
    Messages:
    488
    Likes Received:
    16
    So this site is PHP? Because i did blackhatworld.com/index.html and it gave a 404 error
     
  4. Hubert115

    Hubert115 Regular Member

    Joined:
    Jan 26, 2012
    Messages:
    488
    Likes Received:
    16
    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...
     
  5. migunbed

    migunbed Newbie

    Joined:
    Jul 18, 2012
    Messages:
    21
    Likes Received:
    12
    do a whois lookup to find out what kinds of servers it's running

    do a google search with the url + php in google
     
  6. JimmyWong

    JimmyWong Registered Member

    Joined:
    Feb 24, 2012
    Messages:
    63
    Likes Received:
    165
    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.
     
    Last edited: Jul 27, 2012
  7. secretja

    secretja Regular Member

    Joined:
    Jul 12, 2010
    Messages:
    343
    Likes Received:
    73
    Occupation:
    Web Designer
    Home Page:
    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.
     
    • Thanks Thanks x 1
  8. Amsterdammer

    Amsterdammer Power Member

    Joined:
    Aug 9, 2011
    Messages:
    515
    Likes Received:
    563
    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.
    JavaScript is executed client side as well.
    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. :)
     
  9. Hubert115

    Hubert115 Regular Member

    Joined:
    Jan 26, 2012
    Messages:
    488
    Likes Received:
    16
    damnit... I really needed a way to do this.
     
  10. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    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.
     
    • Thanks Thanks x 1
  11. Amsterdammer

    Amsterdammer Power Member

    Joined:
    Aug 9, 2011
    Messages:
    515
    Likes Received:
    563
    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.
     
  12. madoctopus

    madoctopus Supreme Member

    Joined:
    Apr 4, 2010
    Messages:
    1,249
    Likes Received:
    3,498
    Occupation:
    Full time IM
    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.
     
    • Thanks Thanks x 1
  13. senior

    senior Regular Member

    Joined:
    Jul 20, 2010
    Messages:
    219
    Likes Received:
    101
    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.
     
  14. Rob Whisonant

    Rob Whisonant Junior Member

    Joined:
    Feb 25, 2011
    Messages:
    112
    Likes Received:
    38
    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.
     
  15. jonbenwaa

    jonbenwaa Newbie

    Joined:
    Jul 6, 2012
    Messages:
    12
    Likes Received:
    5
    Occupation:
    web dev
    As said above, using mod rewrites in htaccess can disguise a php site as anything else BUT php. First thing I would try is to view source and see what kinds of extensions are on nav links. are they html, asp, php, etc? If that doesn't lead you anywhere, try looking at comments in the code or in the stylesheets (css) or javascript (js) files for clues. Most sites out there are built using a cms like wordpress or drupal or something like that. If this is the case, chances are there is something left in the comments somewhere in the code of what kind of software being used and you can google it to find it.

    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?
     
  16. partymarty4870

    partymarty4870 Elite Member

    Joined:
    Jul 7, 2010
    Messages:
    2,034
    Likes Received:
    1,690
    Location:
    I come from a land downunder
    um.......maybe just look at the source
     
  17. ulijonroth

    ulijonroth Regular Member

    Joined:
    May 6, 2010
    Messages:
    205
    Likes Received:
    769
    Occupation:
    If you work for a living, why do you kill yourself
    Location:
    localhost
    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. :)
     
  18. MarketWriter

    MarketWriter Junior Member

    Joined:
    Jul 4, 2011
    Messages:
    106
    Likes Received:
    24
    Occupation:
    Marketer
    Location:
    Somewhere On The Net
    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.
     
    • Thanks Thanks x 1
  19. Kiopa_Matt

    Kiopa_Matt Registered Member

    Joined:
    Jun 3, 2011
    Messages:
    99
    Likes Received:
    11
    What are the file extensions of your web page? .html or .php? That will tell you. :)
     
  20. jimbo87

    jimbo87 Regular Member

    Joined:
    Jan 18, 2011
    Messages:
    243
    Likes Received:
    61
    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.
     
Thread Status:
Not open for further replies.