PHP or HTML?

MarioMaster

New Member
Messages
181
Reaction score
0
Points
0
Which is better to use on a website? I don't get the difference between PHP and HTML. What are they used for?
 

konekt

New Member
Messages
100
Reaction score
0
Points
0
HTML is Hypertext MARKUP language. You can't do much more with HTML then present information in a nice, organized, and pretty way. If you want a static web page, like one that simply gives information about something or other then HTML will do.

If, however, you want an interactive page that has users and updating information (like weather for example) then you really need PHP. PHP is a scripting language, it allows you to mutate and access data stored on a server or entered by users. You combine PHP with HTML to dynamically get data (with PHP) and output it nicely (with HTML).

It's sort of like the difference between math and art. With math you can model a function that users can input stuff and get unique output; this is PHP. With art you make something static that others can look at and enjoy but not do much with; this is HTML.
 
Last edited:

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
I like PHP because...
PHP has PHP and HTML
HTML ONLY has HTML.
So a PHP page could be entirely HTML.
:)
 

Jake

Developer
Contributors
Messages
4,057
Reaction score
5
Points
0
HTML and PHP are completely different...

PHP is for processing BEFORE being put into HTML, therefore you must use HTML even if you do use PHP. And if you don't use PHP you'll have a basic non-dynamic website in plain HTML.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
PHP is a computer scripting language, which is commonly used for server-side scripting 'for' websites and just stand-along programs.

HTML is a markup language that is used for websites. It's a way to 'tell' say, a browser, the structure of a given page and its contents.

Two completely different things.
 
Last edited:

shaunak

New Member
Messages
320
Reaction score
0
Points
0
^Exactly....
Its like comparing chalk and cheese!
You might want to look in at: w3schools
 
Last edited:

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
They're both used for 2 completely different things, you might want to use a mixture of both ;).
 

tittat

Active Member
Messages
2,478
Reaction score
1
Points
38
Question:
What is the difference between a PHP and HTML Web page?

Answer:
PHP files are just like HTML files, but they can include both HTML and PHP code. The PHP code is parsed (or executed) by the Web server when the page is accessed and the resulting output is written as HTML within the Web page. When a user accesses a PHP page, his Web browser only gets sent the HTML code, since the Web server has processed the PHP code in the background. Most PHP pages are processed so quickly that it does not noticeably slow down the loading of the Web page.

The .php extension is important, since it tells the Web server that the page may include PHP code. Therefore, it must be run through the server's PHP engine before being sent to a client's Web browser. This allows dynamic content to be generated each time the Web page is loaded, based on the variables included in the PHP code. For example, PHP pages may load objects such as the current date and time, data from form fields submitted by a user, or information from a database. Still, once the page reaches the user's Web browser, everything is formatted as HTML.
 

rockee

New Member
Messages
120
Reaction score
0
Points
0
@tittat.
Your post is a copy and paste from this web site:
http://www.sharpened.net/helpcenter/answer.php?75

Minus any thanks or reference to the original author of the article and is in essence a breach of copyright:
Copyright © 1999-2008 Sharpened Productions. All Rights Reserved.

It would be nice to thank or give a reference to the originating author or even to post a link to the site, not to try and pass of your post as if it were your own authoring - which is commonly referred to as plagiarism.

The correct and no mistakes in the English was the clue that gave you away.

Perhaps a moderator might like to deal with this errant post.

Rocky
 
Last edited:

seven7htangent

New Member
Messages
6
Reaction score
0
Points
0
If you're not familiar with the differences between the two (and there have been some good, concise posts illustrating that difference), i would first learn HTML, learn it well, and be clear on what it can and can't do. Once you understand that, then roll up your sleeves and dive into PHP; the reason being, if you're struggling to get things just to look right in HTML (which you will, if you're in the process of learning it), then imagine the terrible frustration you'll encounter when trying to make those elements interactive...because that's what PHP does.

Basically, PHP 'builds' an HTML web page on the server side. While you can 'View Source" in a web browser and see exactly how and why the page looks like it does, you'll never see the PHP behind a website, because by the time the page gets to you, PHP has already done it's job.

Furthermore, PHP is a great deal more complicated than HTML. Really, HTML is not a programming language...it's a set of tags that tell a browser how to display things, for instance, a green text box might look like this:
<div height="200" width="200" background="green">Some Text</div>
It's just formatting, plain and simple. PHP, on the other hand, is what you would use to make the page load "Some Text" automatically from a database, in the form of a news article, or a greeting to a specific user who has logged in.

These days, just about every site on the web uses a PHP backend, or something similar to it, so learning the language is a very worthwhile investment of your time.

Hope this helps.
 

reglus

New Member
Messages
62
Reaction score
0
Points
0
I totally agree with you. I am very god with html after learning it but I have just moved onto php. Woah I wasnt prepared. Thees so much to it. Its not similiar to html atall and you also need to know a nit of mysql to get most things to work.

:thefinger
 

stocks

New Member
Messages
22
Reaction score
0
Points
0
HTML is great for static sites, but if you want to generate pages programmatically (or if you need to access a database like MySQL) you'll want to move to PHP or Python. You can learn about HTML and PHP (as well as CSS and a host of other languages) from the W3Schools tutorials, some of the best on the web.
 

nciampa

New Member
Messages
7
Reaction score
0
Points
0
My vote is learn php and html together, PHP will enable you to do mutch more thrn just using html.

For example:

Mail, File Management, MySQL Databases, Loop's If's and Else's
 

Jose Magsino

New Member
Messages
53
Reaction score
0
Points
0
Why not use both ? :biggrin:
Yeah why not use both?

But anyway, if your page is constantly changing/evolving then PHP is on the go..and take note that PHP do processed the script so that it will be rendered as HTML..but if it is just a static then I believe a HTML will be the best, since it will be faster compared to PHP.
 

hopper

Member
Messages
225
Reaction score
0
Points
16
i see a lot of good points presented above
to distill into a short post
you have to know HTML to do php
if a web page were a clock, HTML would be the clock face and PHP would be the gears behind the clock face
building an HTML page would be the equivalent of drawing a nice picture of a clock
programing in php would be the equivalent of building a clock that works, but unless you know how to design a clock face then all the gearing in the world will be useless.
 

xprtweb

New Member
Messages
30
Reaction score
0
Points
0
It would depend on what you want your site to do/be. If you want just a simple showing a few pics and some static information, the html would suffice. If you need some more complex elements, like forms and other elements involving interaction with visitors, then it is not sufficient and you would then require some server side processing language like PHP.
 

Smith6612

I ate all of the x10Pizza
Community Support
Messages
6,518
Reaction score
48
Points
48
PHP is the best and you can do the most with it right now with things such as dynamically generated pages, but HTML is the best for static pages and content, and for server load.
 

hotshotddd

New Member
Messages
1
Reaction score
0
Points
0
is there any why to convert php files to html files?
can any one help me pls...........
 
Top