html vs php

by 10 replies
13
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">


this is html syntax correct? or is it php?
#programming #html #php
  • It's often used together with CSS
    • [ 1 ] Thanks
    • [1] reply
    • oh wait....even if the file name says .php???
      • [1] reply
  • That particular snippet of code is HTML. PHP code would be contained within the PHP tag which opens with <?php and closes with ?>. For example, within your html you might find something as such:

    <!DOCTYPE html>
    <html>
    <body>

    <?php
    echo "Hello world!";
    ?>

    </body>
    </html>
  • HTML is a tag language it's not a programming language. It's mostly open this close that <body> </body>... HTML is used more for the structure, look, design.

    If you need actual programming, dynamic websites then that's where php comes in. PHP is what you would use to take what user is doing and using code do that command. EX:

    Here's how a login page would look with html / php.
    - Webpage loads
    - HTML & CSS display how the page looks.
    - Within this page is a login box that shows email address and password.
    - You, the user, enter your email address and password and press enter.
    - The php code takes this information and checks with the database to see if the information is valid.
    - If information is correct then the php code sends sends you to the members area and creates session to remember that you are a member (so that it doesn't keep asking you over and over).

    Not necessarily in that order but you get what I mean.

    Oh and btw what you entered is HTML. If you keep scrolling in the code you'll see a </section> followed by a </div> and if it's properly commented then it'll tell you that this section ends here and this div ends here.
  • It is a html code with css attachment. It is not a PHP code.
  • Its HTML Tag including PHP,CSS

    Because class and ID is coming on PHP part and < >
    • [1] reply

    • That's right it is HTML code the "id" and "class" serve CSS ...or/and javascript purposes and a .php file could contain no less than all of them javascript, php, html, css languages
  • This is pure html code.
  • Html Vs Php:
    1.Html is a language used to describe how to display text in a web browser or in a browser window where as Php is a scripting language and can be used to create webpage written in html.

    2.Html works on Client Computer where as php runs on Server side.

    3.Html is amarkup language used to create static webpage where as php is a programming language used to make the html page dynamic.
  • Banned
    [DELETED]
  • Banned
    [DELETED]

Next Topics on Trending Feed