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.
2007-11-12 04:48:49
·
answer #1
·
answered by Alex 3
·
4⤊
0⤋
PHP is a scripting language (programming) and HTML is a markup language (text editing). They each serve different purposes in web development, and whether or not you need to use them both depends on your needs as a developer.
HTML is the backbone of a web page, and it defines among other things the layout, text, images and so on. Since it defines the content (we'll keep it simple and not get into metadata, databases, or dynamic web pages), without HTML you wouldn't even have a web page.
PHP is the brains, so to speak, of the site. It is similar to C++ but a lot less strict in its syntax, and since it's a scripting language it doesn't need to be compiled (turned into machine code). It allows you to do such things as create forums, guestbooks, registration forms, online stores, etc. Basically any kind of interactive/dynamic content in a web page is handled through scripting, and while there are many different languages/methods out there which can accomplish this, PHP is one of the more popular.
If I make an analogy, HTML is the library and PHP is the librarian. All the information is there with HTML, but PHP can interact with the visitors and perform administrative tasks, searches, and many other useful things-- but a librarian still needs a library in which to work.
Hope that helps!
2007-11-12 04:58:37
·
answer #2
·
answered by A. Rose 2
·
3⤊
0⤋
PHP is used on server side, while you are building HTML the PHP can be embedded into HTML. PHP is server side scripting language. HTML is more generic markup language can be use on both client and server side.
These are two different things you try to compare, but utilizing PHP on server HTML will make your HTML more dynamic and better.
Use the following link for better PHP instruction:
http://www.w3schools.com/php/
2007-11-12 04:53:08
·
answer #3
·
answered by Scott P 7
·
1⤊
0⤋
PHP and HTML are 2 totallly different things and are used for totally different purposes.
HTML (Hypertext Markup Language) is used to design your web page..such as design tables, ut in text, bold the text, give background colour, add text boxes etc...it handles the designing part.
Where as php is used to make your website dynamic because it allows you to add / delete / update/ access data from a database.
So for example you want to make a feedback form on your webiste, then you will use HTML tags to place the title on the form, the text boxes, lables, submit button etc. But to actually save the data that the user enteres in thos text boxes intoa database, you will use PHP. Html does not allow database access.
PHP allows you to send emails to an email address, upload data etc.
So from the above you can undersatnd that HTML is a form of static designing..the layout of the page whereas PHP makes your page dynamic by giving database access
2007-11-12 04:51:59
·
answer #4
·
answered by Anon_girl 2
·
3⤊
0⤋
As far as I know so far, PHP is a server site scripting language while HTML is a client side scripting language. PHP makes a page based on server guided parameters like the current date and time, data base info, ect. HTML is static which means what you see is what you get and is not guided by any type of server parameters.
2007-11-12 04:49:57
·
answer #5
·
answered by Jamaal E 3
·
1⤊
0⤋
PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses. PHP is a recursive initialism for PHP: Hypertext Preprocessor.
The main implementation is produced by The PHP Group and released under the PHP License. This implementation serves to define a de facto standard for PHP, as there is no formal specification. The most recent version of PHP is 5.2.5, released on 9 November 2007. It is considered to be free software by the Free Software Foundation.[2]
HTML, an initialism of Hypertext Markup Language, is the predominant markup language for web pages. It provides a means to describe the structure of text-based information in a document — by denoting certain text as headings, paragraphs, lists, and so on — and to supplement that text with interactive forms, embedded images, and other objects. HTML is written in the form of labels (known as tags), surrounded by angle brackets. HTML can also describe, to some degree, the appearance and semantics of a document, and can include embedded scripting language code which can affect the behavior of web browsers and other HTML processors.
HTML is also often used to refer to content of the MIME type text/html or even more broadly as a generic term for HTML whether in its XML-descended form (such as XHTML 1.0 and later) or its form descended directly from SGML (such as HTML 4.01 and earlier).
2007-11-12 04:48:51
·
answer #6
·
answered by James Gretsch 1
·
2⤊
0⤋
They are totally different. You need html or a derivative to display web pages. php is a programming language, albeit very basic, which is capable of manipulating data and can be used to build html pages. It is extremely powerful for creating dynamic pages.
2007-11-12 04:57:43
·
answer #7
·
answered by Anonymous
·
2⤊
0⤋
Uhm. Everything. HTML is a coding language, PHP is server-side scripting.
It's like asking what's the difference between MySpace and a computer. They're two different things.
You'd want to know HTML / XHTML before trying to learn PHP.
http://w3schools.com/xhtml/default.asp
http://w3schools.com/php/default.asp
2007-11-12 04:50:33
·
answer #8
·
answered by mirror_of_twilight 3
·
0⤊
0⤋
PHP is a programming language that can be used to generate HTML. HTML itself is just a markup language, not a programming language.
2007-11-12 04:51:15
·
answer #9
·
answered by Runa 7
·
1⤊
0⤋
HTML contains instructions for the page viewer's computer, telling it what to display.
PHP contains instructions for the page server, telling the server (the holder of the files) what to send to the page viewer, and why, and how, and perhaps when.
You definitely need HTML.
You may need PHP.
2007-11-12 05:22:37
·
answer #10
·
answered by fjpoblam 7
·
2⤊
0⤋