Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   html vs php (https://www.warriorforum.com/programming/1080156-html-vs-php.html)

TAHERSYED34 3rd June 2015 11:25 AM

html vs php
 
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">


this is html syntax correct? or is it php?

artemis360 3rd June 2015 12:39 PM

Re: html vs php
 
It's often used together with CSS

TAHERSYED34 3rd June 2015 10:54 PM

Re: html vs php
 
Quote:

Originally Posted by artemis360 (Post 10095534)
It's often used together with CSS

oh wait....even if the file name says .php???

Daniel Santos 4th June 2015 12:52 AM

Re: html vs php
 
Quote:

Originally Posted by TAHERSYED34 (Post 10095411)
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">


this is html syntax correct? or is it php?

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>

samntly 4th June 2015 04:52 PM

Re: html vs php
 
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.

David Beroff 4th June 2015 07:53 PM

Re: html vs php
 
Quote:

Originally Posted by TAHERSYED34 (Post 10096347)
oh wait....even if the file name says .php???

Right. As I tried to describe before, you'll typically flow back and forth between HTML and PHP in the same file, depending on what you're doing. Your filename extension will be .php, but it usually doesn't make sense to just stay in one or the other. I posted a real-world example for you earlier so you could see how this back-and-forth works when you're actually trying to do something, rather than just run simple examples. I think it would be helpful for you to walk through that code and get a general understanding of when it's using which and why.

In order to learn this stuff better, you'll have to actually get your hands dirty and jump in and write some code! :D

hostbudget 5th June 2015 04:03 AM

Re: html vs php
 
It is a html code with css attachment. It is not a PHP code.

nicholas28 5th June 2015 05:06 AM

Re: html vs php
 
Its HTML Tag including PHP,CSS

Because class and ID is coming on PHP part and < >

seven4 5th June 2015 05:11 AM

Re: html vs php
 
Quote:

Originally Posted by TAHERSYED34 (Post 10095411)
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">


this is html syntax correct? or is it php?

This is pure html code.

ShreyaSharma 8th June 2015 11:02 AM

Re: html vs php
 
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.

Anne85 9th July 2015 11:59 AM

Re: html vs php
 
Quote:

Originally Posted by nicholas28 (Post 10098938)
Its HTML Tag including PHP,CSS

Because class and ID is coming on PHP part and < >


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 ;)


All times are GMT -6. The time now is 07:21 AM.