lucerias Posted November 7, 2006 Share Posted November 7, 2006 I am quite new to PHP, I saw many of PHP examples were coded like this, HTML is used for interface and structure design, PHP is used to process the input and then pass it to HTML and display the output. But can PHP do interface design without HTML help? I mean all the thing just do in PHP without HTML. If it is possible, then why do we follow the standard like that. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/26422-php-and-html-connection/ Share on other sites More sharing options...
bqallover Posted November 7, 2006 Share Posted November 7, 2006 I think it's mainly down to personal taste. One of the most important things I use PHP for is 'templates' (or including headers/footers/etc.). This is a very powerful technique that allows you to effectively separate your script from your HTML. Of course there's always some cross-over.There are many PHP libraries that deal with such display abstraction. You might want to have a look at [url=http://smarty.php.net/]Smarty[/url]. Quote Link to comment https://forums.phpfreaks.com/topic/26422-php-and-html-connection/#findComment-120829 Share on other sites More sharing options...
wildteen88 Posted November 7, 2006 Share Posted November 7, 2006 [quote author=lucerias link=topic=114110.msg464134#msg464134 date=1162887154]I am quite new to PHP, I saw many of PHP examples were coded like this, HTML is used for interface and structure design, PHP is used to process the input and then pass it to HTML and display the output. But can PHP do interface design without HTML help? I mean all the thing just do in PHP without HTML. If it is possible, then why do we follow the standard like that. Thank you.[/quote]No. PHP is a programming language and a web browser can not understand PHP. Browsers can only understand client side languages such as HTML, CSS, Javascript etc. PHP is used as you said to process user input/to make you site dynamic etc. If you use PHP you still need to use HTML in order for the browser to display your website when someone goes to it. Quote Link to comment https://forums.phpfreaks.com/topic/26422-php-and-html-connection/#findComment-121098 Share on other sites More sharing options...
Skatecrazy1 Posted November 7, 2006 Share Posted November 7, 2006 Yeah basically PHP passes data through the server's PHP installation which processes what HTML to output. Quote Link to comment https://forums.phpfreaks.com/topic/26422-php-and-html-connection/#findComment-121141 Share on other sites More sharing options...
lucerias Posted November 8, 2006 Author Share Posted November 8, 2006 [quote]No. PHP is a programming language and a web browser can not understand PHP. Browsers can only understand client side languages such as HTML, CSS, Javascript etc. PHP is used as you said to process user input/to make you site dynamic etc. If you use PHP you still need to use HTML in order for the browser to display your website when someone goes to it.[/quote]For example, the browser can enter into URL/index.php and from here, we can code everything inside the .php or link with other .php, so why we still need html? Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/26422-php-and-html-connection/#findComment-121351 Share on other sites More sharing options...
doni49 Posted November 8, 2006 Share Posted November 8, 2006 This a typical example from my web sites. HTML code that's common to all pages in the web site, is either in Header or Footer. So if I need to change something that effects all pages, I change it ONCE and I'm done.[code]<?php$pgTitle = "Home Page";include('header');Show my page specific HTML content here.include('footer');?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/26422-php-and-html-connection/#findComment-121356 Share on other sites More sharing options...
trq Posted November 8, 2006 Share Posted November 8, 2006 Your missunderstanding what php does and what html is.[quote]so why we still need html?[/quote]We dont, but without it your pages are just plain text. Html is the markup language (Hyper text markup language) used to markup data on the web.Php just outputs strings, wether they contain html for use on the web, or are just plain text for use in other places. Quote Link to comment https://forums.phpfreaks.com/topic/26422-php-and-html-connection/#findComment-121362 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.