PHP vs HTML

alexport

New member
Joined
Mar 25, 2015
Messages
12
Best answers
0
Ratings
6
Points
0
#1
Hi, can you guys please explain me what is the difference between PHP and HTML files?
Can anyone send me examples of codes using html, php, and both html and php combined? or is it possible to use both PHP and HTML in separated places but they will be combined in a place to build dynamic webpages?
Your comments would be appreciated.
Thanks in advance.
Alex
 

jeffzod

New member
Joined
Aug 2, 2017
Messages
3
Best answers
0
Points
0
#2
Hi alex,
You can combine both PHP and HTML in your code.You need to write HTML code and close the tags before starting writing PHP code.PHP code can be nested in HTML code and viceversa
 
Joined
Aug 3, 2017
Messages
5
Best answers
0
Points
0
#3
Learn both if you have the time and if you feel it necessary. Otherwise learn Javascript, or CSS in conjunction with HTML. All of these languages are adequate for optimizing your website. However, you have to make them do what you want them to do.
 

clinkguts

New member
Joined
Jul 26, 2017
Messages
2
Best answers
0
Points
0
#4
If you are a newbie, then you should go for HTML and CSS at first.After this, you can continue with PHP and javascript.
And, yes you can use PHP and HTML together.
 

24x7serverman

Well-known member
Joined
Jul 25, 2017
Messages
651
Best answers
2
Ratings
72 6
Points
28
#5
PHP is programming language, HTML is not the language. It just define the structure and layout of your website. Web pages created in PHP which are written in HTML. PHP is server side scripting language which processes server side requests but produces the output at client's end. Web browser processes the HTML requests while web server processes PHP requests.

You can definitely combine PHP and HTML code. If you are already having knowledge of PHP then only go with PHP coding else it's good to start with HTML and then write the script if necessary in Javascript. You can write CSS in HTML so it's good t go with HTML if you're beginner.
 

Fuzyon

New member
Joined
Aug 9, 2017
Messages
14
Best answers
0
Points
0
#6
HTML is a markup language on which every website is built. You pretty much create the "skeleton" of the website with this language and then spice it up with CSS. PHP is a programming language designed for backend. It's used to make the connections between the server-side of a site and its front-end (HTML).
 

jason223

New member
Joined
Sep 1, 2017
Messages
9
Best answers
0
Points
0
#7
HTML is for frontend and PHP is more on backend. Uf you combined PHP and HTML in a single file you will end up getting PHP file. I suggest to you to learn HTML and CSS then proceed to PHP.
 
Joined
Sep 25, 2017
Messages
15
Best answers
0
Ratings
1
Points
0
#10
dhovorka
Yes, I agree with Jason, PHP is server side language while HTML is in fact the front end code. PHP requires on the server an interpreter/translator and produces on request from a webserver (like Apache) actul HTML code. In your browser will never arrive PHP code, your bowser does understand only HTML (if we compare this two). Now depending on your skills from the past, if you had experience in and development than PHP is easier to start with. With HTML you need understand layout aspects, how the website is build from containers and ofcourse in todays world everythign is about responsive design, transforming your side based on the screen resolution of your device. There is no short anwser but i hope this helps a little
 
Joined
Sep 3, 2017
Messages
32
Best answers
0
Ratings
1
Points
0
#8
The difference to both is the functions and the codes used in the way they are in a website. HTML is easier than PHP to learn beacuse HTML is more on designing and PHP is for funtions of the website and about you question if they can be combined of course, combination of PHP and HTML results in a better outcome of the website.
 
Joined
Sep 15, 2017
Messages
9
Best answers
0
Points
0
#9
Well, I don't think it is a matter of one vs the other since they aren't exactly one in the same, but it is difficult to manage using one without the other. PHP helps with databases and recorded or stored input. HTML is more of a frame of the website and Javascript is like the cover. So if we put this into computer terms, I would say PHP is the motherboard, cpu, RAM, and ROM while HTML is the frame and screws which everything fits into. And Javascript is the outside casing and GPU because it makes things look better but isn't actually needed as it is an optional component to a website.
 
Joined
Oct 26, 2017
Messages
4
Best answers
0
Ratings
1
Points
0
#11
In a nutshell, HTML files are just a static files while PHP files are for dynamic. Meaning you can insert variables and perform computations in the PHP files. But I think it will make more sense if you would learn HTML, CSS, and Javascript first before proceeding to PHP for the backend. That way you will avoid confusion.
 
Joined
Oct 28, 2017
Messages
9
Best answers
0
Points
0
#12
I think you can't really compare the two, they are two different language,html use for marking up the page, while PHP use as a scripting language that can be embedded to html, and its also a server side language which means that it only runs on server, and if you are going to learn it you are going to need a local server in order for you to run your php files, unlike html that can run directly in your browser without local server. Although PHP is really nice and powerful language but it can't beat html vice versa because they both got there advantage in different aspect of web development.
 
Joined
May 10, 2019
Messages
30
Best answers
0
Ratings
3
Points
8
#13
HTML and PHP can't be compared. HTML is a markup language whereas PHP is the scripting language. PHP code is written within HTML tags. In terms of learning, HTML is easy to understand as compared to PHP. HTML, CSS and Javascript needs to be learn before starting PHP.
 

Malcolmjr96

Moderator
Staff Member
Joined
Apr 18, 2016
Messages
419
Best answers
4
Ratings
100 9
Points
28
#14
Like some have said above, PHP & HTML are two different things. HTML is a Markup language and can be considered as the skeleton of a webpage. PHP adds things such as the ability to login etc.
 

hostnetindia

Active member
Joined
Apr 4, 2019
Messages
81
Best answers
3
Ratings
16
Points
8
#15
PHP - hypertext preprocessor language
Html - Most common coding use to build up a website structure and PHP is a backed images where your sites become more modern as you want.
There is no comparison them.
 
Recommended Threads
Similar Threads
Replies
2
Views
1,569
Replies
18
Views
3,509
Replies
4
Views
2,441

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top