answersLogoWhite

0


Best Answer

PHP is used with HTML to interact with the web server to process forms, access and manipulate database information and a variety of other processes. HTML alone cannot interact directly with the web server. HTML is primarily used to tell the browser where to place text and images to create the web page. PHP interacts directly with the server to process data and display it on the web page using HTML. You can display a web page with only HTML, but if you have any data in a database on your server, for instance, you must also use PHP (or a similar programming language like ASP, Perl, etc.) to access that data.

Quite a few websites, if not a majority, only need HTML to display their information. PHP is definitely not required in many cases. HTML, or an XML variation, is alway required to display a web page.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

HTML and XHTML are the primary technology used to mark up web pages. Proper use of these technologies simply marks up the meaning of the pages. To specify the layout and visual design, you use CSS. All of these languages (HTML / XHTML, and CSS) are markup languages, which means they are not 'true' programming languages. They are used to set up a page, but they do not allow more advanced techniques like saving files, storing data, sending emails, and interacting with database systems.

If you want to make your web page more interactive, you need to add a programming language. Web programming languages come in two flavors: Client-side languages are embedded into the web browser. Of these, JavaScript is most popular, because it interacts directly with the web page and is included with nearly every browser. (Java and Flash applets are also popular, but they are logically separated from the page.)

PHP is the most commonly used server-side programming language. When you write a program in PHP, the web server sends the code through the PHP interpreter. PHP programs produce HTML / XHTML and CSS as output, which is sent to the client. An HTML page with a form can send its data to a PHP program on the server.

Essentially, PHP uses HTML as its user interface mechanism. The user never sees any PHP. By the time it gets to the user, it's HTML or XHTML. This means PHP programs can be written without much concern about what type of browser the user has.

The most common use of PHP (and other server-side languages) is to interface with relational database management systems like MySQL. This allows the developer to build a dynamic web site with much of the content embedded in a database. Content management systems are an example of data-driven web development. Such systems allow a user with little technical knowledge to update a web site by interacting with online forms. Most commercial websites today use some form of a content management system. Drupal and Joomla are the most commonly-used CMS systems today, and both are based on PHP and MySQL.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

HTML is the language used to display content on a site, PHP just lets you use that HTML in different ways, add stuff to your mysql, or just calculate and do other various applications which HTML can not do.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

PHP is for handling requests from the user/browser, processing any data necessary, making decisions, or anything which requires logic.

HTML is for presenting data/content to the user within a web browser.

Ideally, the 2 should be kept separate where possible.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between PHP and HTML?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the various ways to embedded PHP in HTML coding?

there are in fact two basic methods - one is called minimal PHP, and the second tends to be referred to as the CGI-way. minimal php means that you're making php secions in HTML only where really necessary (using the php section begin (<?php ) and end (?> ) tags.). the CGI-way, or maximum PHP means, that you're in fact embedding HTML into strings in php, and the whole page is echo()ed. the second way tends to be viewed as an abuse of php by some people, as php was meant to be "templating" language, and designed to be used mainly the first way.


Why you do not see any PHP code when you view the source code of a PHP page in the browser?

PHP is server-side, the browser itself does not interpret it. Rather, the browser sends a query to the server, and the PHP scripting generates custom HTML document. It is this HTML that you are seeing the source code of.


Can HTML tags code and text be included in a php code?

Yep. We do it all the time. One way is to simply tell PHP that you want the tags echoed. Like so: <?php echo('<b>Hi</b> Nice to meet you!'); ?> Sometimes you want instead to simply use the PHP in parts of a page and leave the rest. You can do this, too. <body> <div class="login"> <?php if($user->loggedIn()){ ?> <b>Hi!</b> <?php }else{ ?> <!-- HTML FORM HERE --> <?php } ?> </div> </body>


How do you connect MySQL to HTML with Microsoft Office Frontpage?

You can't. Frontpage is just an editor, and you can't connect mySQL to HTML. You can do it with PHP, though.


Why can a CSS sheet fail to work properly after converting a web page from HTML to PHP?

AnswerThe web browser cannot tell whether the page information arriving at the browser comes from a PHP source or an HTML source. So if the HTML version works and the PHP version CSS is broken you have translated the page incorrectly. Examine the page source from the browser window for both versions and compare them closely. The PHP version must reference the CSS file correctly in the header. Check that in particular. :]

Related questions

How do you put HTML in PHP?

Its done exactly the same as when you put it in an HTML file. There are 2 ways you can do it: <html> <?php // php stuff ?> </html> Or you can do it like this: <?php echo "<html>"; // php stuff echo "</html>"; ?>


How do you use PHP in HTML?

You can't use PHP in an HTML document, but you can use HTML in PHP script.


I have a HTML website I want to use a php script I have but the main php file has the info in it and I want it to be on the HTML site how can I embed or use the php code without using frames?

change the extention of the .HTML file to .php and then open the file that was previously HTML and put <?php include ("path/to/second/php/file.php"); ?> so for example if i have page1.HTML and page2.php i rename page1.HTML to page1.php and then put <?php include ("page2.php"); ?> where i want page2 to appear. Note: Any HTML file can be renamed to have a .php extention even if it doesnt contain any PHP.


What is the difference between single quotes and double quotes?

in programming, single quotes are for characters, and double quotes are for string, but in php, javascript, html, css i don't see any difference between the two.


Can you embed a php file project into a HTML page so the php project is shown between the HTML?

If you want to show the folder in html just use link reference in html. For example: <a href="/path/to/folder">PHP File Project</a> If it is on a server do remember to get real path of folder


How do you go from HTML form to php?

Build your form in HTML and specify your PHP file in the action of the document. HTML does the form stuff, PHP the processing (although you can - of course - use HTML inside PHP via print() or echo(), too)


How do you get data back and forth between HTML and PHP?

Via AJAX. Another simpler way would be to use form elements and submit them via html and let PHP process the data. Processed data can be output in html form via echo or print statements in php.


What is web 2.0 HTML?

In truth, there's almost no difference between the HTML used in web 2.0 applications, and the HTML used in all other HTML applications. The difference is mainly in the way that the user interacts with the page, and this is provided mainly by the tighter coupling of JavaScript and backend programming like PHP, as well as the ability to transfer data between both using asynchronous calls (AJAX.)


How does PHP differ from HTML in terms of application and structure?

In structure <?php ?> <html> </html> in application - one is static and another is dynamic. this much ......


Difference between apache and PHP?

Apache is a web server. PHP is a scripting language.


What does PHP include in terms of html coding?

To do programming in PHP, there is often the dilemma of whether or not to place the code within the HTML. Depending on the writer's coding experience it is usually better to place the PHP within the HTML.


Does netscape support php?

PHP support is not up to the clients (browsers). If it runs on the server, then HTML is served to the client. PHP may have generated the HTML, but that does not matter to the client.