1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

PHP What is the difference between PHP and XHTML code?

Discussion in 'Web Development' started by Anna Hussie, May 11, 2011.

  1. Anna Hussie

    Anna Hussie Banned

    I am kinda new to this but, what benefits does PHP over xhtml and vice versa.

    I am trying to create a website where people can login but I don't now what type of code is best for me.

    Any Suggestions?
     
  2. Geoff Tyrer

    Geoff Tyrer Member

    PHP and XHTML are very different because XHTML is executed by the web browser and PHP by the web server.

    If you want people to be able to login you will have to hold valid user names and passwords somewhere - most likely on the web server. You would thus need to use PHP (rather than XHTML) to check that what your users entered was valid.

    Hope this helps. Feel free to ask further questions.
     
  3. jsck82

    jsck82 New Member

    One other difference is that (to put it in rather simple terms) the PHP generates the appropriate XHTML code (usually from instructions you provide) based on conditions, making dynamic (fluid or changing) content. XHTML is static (unchanging) and will always look the same (barring scripts, which are then not XHTML)
     
  4. almedajohnson

    almedajohnson New Member

    xhtml is used to create invisible (or visible) boxes that you can (or cannot) physically see. You then use CSS (a style sheet) to edit those boxes to be the size, color, and position that you want. These two are used to make the part of the website that you see. (those xhtml boxes are <div>’s … xhtml can be used for more but this is just a general overview)
    PHP is a server-side language that the client (whoever is visiting your site) will never see. It gets executed on the server before its sent to him.
    You use php to make web pages dynamic, like your login stuff and this yahoo answers stuff we’re typing in. We type it in, it sends the information to the server where the server-side language (php) in your case plays with it and saves it in databases (php is normally used with mysql). PHP is for all the behind the scenes stuff while xhtml and css are used to make the look and feel of the page.
     
    kathygreen likes this.
  5. qeemat

    qeemat New Member

  6. nicecomputer

    nicecomputer New Member

    HTML-known as extension hypertext mark up language this is newly version of HTML.

    PHP -Programming language that is free, most commonly used with MySQL, also
    free. Usually run on Linux or Unix servers though it can be run on Windows.
    In my opinion, it is similar to programming JavaScript, but on the
    server-side.
     
  7. SkipDover

    SkipDover New Member

    PHP is a server side scripting language which is used to create dynamic XHTML and sent to browser.

    XHTML is just a markup language which browser can recognize and use to design the user interface.

     
  8. alice789

    alice789 New Member

    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.


    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.
     
  9. Armando J. Davis

    Armando J. Davis New Member

    XHTML is the language that is use to create various objects such as tables,frames,forms which we can see on local machine browser but PHP is server side scripting language which can be used for validation purpose at server side while XHTML is non validating language.
     
  10. alfredmarshall

    alfredmarshall New Member

    Hello, According to me its hard to compare PHP and XHTML but the main difference is that-:
    PHP- It is a server side scripting language which is used to generate dynamic XHTML executed by the server and sent to browser.PHP is pre-processed by the server and converted into XHTML.
    XHTML- It is just a mark up language which browser can understand and use to design the user interface.XHTML is a static information-based markup language executed on the client side.
     
  11. daviddakarai

    daviddakarai Member

    PHP and XHTML are very different,PHP is a server side scripting language and XHTML is just a markup language which browser can recognize.