I don't wish to appear pedantic here, but it seems to me that expressing the proposition as "HTML vs PHP" can be misleading: as though one or the other can be used exclusively to produce a Web page. Of course that is not so -- Markup (HTML/ XHTML et al) must be used to produce a document that will render in User-Agents (Browsers) while PHP is one of several scripting languages that can be employed to manipulate such document rendering. I think the question is better put as "what is the difference between HTML and PHP?" James
hi james, Thanks for your 3 "replies".. But i think after giving topic name as PHP vs HTML in that thread i had clear written ""Please explain me the difference between PHP and HTML files??"" Hope u getting what i like to say Any ways Thanks .. Rohit
exactly, the best question can be "what is the difference between HTML and PHP?" but what i belive is, this topic poster really wanted to know the difference but he mistakenly write vs.
Hello Rohit, Thanks for your PM i explained the difference in one of my previous posts if you got chance to look there.. let me try to explain again more clearly; HTML: HTML stand for "hyper text markup language", its just a markup language that browser can understand.. Internet browsers cannot understand any server side programming language like PHP, ASP, etc.. Internet browser can only understand HTML for dressing up the contents (layout design), as well as HTML, browsers can also understand all the client side scripting like javascript.. What is an HTML File? * HTML stands for Hyper Text Markup Language * An HTML file is a text file containing small markup tags * The markup tags tell the Web browser how to display the page * An HTML file must have an htm or html file extension * An HTML file can be created using a simple text editor where PHP is a server side scripting.. a programming language (please note: HTML is not a programming language, its just a markup language, here markup means, its designs page contents in between tags like if you want to make bold anything you will do this <b>Nadir Ali Shah</b> here nadir ali shah has been enclosed in html tag b.) so PHP is a server side programming language.. Browser cannot understand PHP directly, But browser can understand PHP.. So, the question is, how browser will display the contents of PHP.. actually when you make a request of PHP page, it first goes to the webserver (like apache or IIS), these web servers translates (interprets) PHP coding and generates its HTML, then web server throws the generated (translated or interepreted) HTML to the browser so that browser like IE or FF can understand and can display the contents of PHP file.... not sure you are a beginner or what.. but if you want to make an start... try w3schools.com.. excellent resource for the beginners.. hope this explaination will be helpful.. Thanks for your time.. many thanks and kind regards,
Hi, Rohit. You are welcome and please accept my apologies -- I often forget what I read these days: "There are three sure signs of growing old; the first is loss of memory -- I have forgotten the other two." James
Thank you very much webexpert for explaining so finely the difference between PHP and HTML.. Thanx once again hope same response in future also
hm.... PHP vs HTML? thats cant work. PHP is a preprocessor of HTML, without HTML PHP can't really work. PHP works with HTML. PHP vs ASP, PHP vs JPS yes PHP vs HTML... no You can't make a login system with just HTML You can't connect to a MySQL database with just HTML You can't do hardly anything interactive or server side with just HTML there is no competition here as they dont do the same thing.
HTML does not give you the opportunity of logical programming for the webpage. PHP will let you do that. You can write HTML code in the note pad and save it as *.htm to check it. But for php you need interpreter or server to check your code.
I do not know what you mean by "logical programming". However, hand-coding HTML via text editors can produce elegant semantic Markup with no problem. Most good editors (I use HTML-Kit) provide for editing and checking a great variety of coding (including PHP). Similarly, Markup can be dynamically checked (WYSIWYG) in all installed user agents (including graphical Browsers) during page composition. I do this regularly. Here is one of my pages that uses PHP for pre-processing and then serves a content-negotiation page as "real" XHTML (with content MIME type application/xhtml+xml) to XML compliant graphical Browsers such as Firefox, Opera, Safari, et al and as XHTML served as HTML (content MIME type text/html) to MSIE Browsers. BTW, I associate (via .htaccess) the .htm file extension with HTML & XHTML pages served as content MIME type text/html and the .html file extension for XHTML pages served as content MIME type application/xhtml+xml. James
PHP = awesome site HTML = lame sauce. I would recommend PHP. It looks nicer and its easier to manage!
Exactly Mr webexpert, This answer is lil bit different and informative too.. So Thanks for prompting me Regards Rohit
I would like to reply to the original questions, i.e PHP and HTML files. HTML files are sent directly to the client's browser as it is from the server. Wherever a files is of type PHP, it will pass through a processor first, then the result will go to the client's browser.
wow.. found an interesting thread. learnt a lot frm it. thanks to those who hv posted nice information and thank the thread creator off course.
Simply, you can say that, html is used for designing static sites while php is used for making dynamic sites.