Thread: PHP vs. HTML?

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    PHP vs. HTML?


    So im lost in the difference between php and html. I know html is client-side and php is server-side but beyond that i have no clue. Can anyone send me examples of sites using html, php, and both html and php combined? I think that would really help.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    In the context of a website, HTML is the data that PHP outputs when it finishes running. HTML defines the structure and, to some degree, the appearance of a web page. If you're learning to build web sites, you need to learn HTML first.

    Generally speaking, any site that's big enough to receive more than a handful of visitors per month isn't going to be built with only HTML. You might find static HTML sites for small local businesses, but any site that generates revenue online is not using only HTML.

    You won't find any sites that are built with only PHP, because PHP by itself is not capable of rendering a web page without using HTML. You will find web services that use PHP + some output format other than HTML, like XML or JSON, but those are designed strictly to be read by other computer programs, not by humans.

    In most cases you cannot tell for sure whether a given site is using PHP or not. Even if the URL ends in .php, that doesn't necessarily mean the site is using PHP (although it probably is).

    These forums use PHP + HTML.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    Ithaca
    Posts
    68
    Rep Power
    3
    HTML is a markup language that displays the text, image and anything else you want to the browser. PHP is a programming language, it usually handles business logic with conditionals, loops, arrays and objects. You can use HTML inside PHP's echo or print statement, but to use PHP in a HTML file can be tricky. Anyway just like the last poster said, its better off for newbies to learn HTML before going to PHP.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0
    PHP really comes in useful when you're working with a database. For example, you can store all of your user accounts in a database and when a member enters the correct username and password your PHP program/script will fetch the relevant user details from the database and display them in the user's browser.

    With html it's only really possible for everyone to see the same page, the page won't look different or display different information depending who's looking at it, everyone pretty much gets the same.

    Of course everything's always changing and it's entirely possible to do a lot of advanced stuff just using html5 now but I really don't know much about that at all.

    If you're just getting started I'd really recommend concentrating on html and css first, then deciding if you want to go down the javascript or php route. There's a mountain of free resources out there to learn from:

    htmldog[dot]com[slash]guides[slash]htmlbeginner[slash]

    developer[dot]mozilla[dot]org[slash]en-US[slash]learn

    Codecademy have recently started releasing lessons for a new PHP course: codecademy[dot]com/tracks/php

    Have fun!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0
    Well I registered a game development company website. I plan on having a home page, a media page (click on the link, a drop-down bar lets you choose either video, screenshots, or concept art), a projects page, and forums to start off. And I'd like to code it all myself. Would PHP allow the drop-down bar? And would I be able to code the forums using PHP?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0
    For a drop-down navigation bar you want to be looking at JavaScript and jQuery more than PHP. There are thousands of tutorials out there for JQuery dropdown navigation so just google around and you should be able to find something that matches your skill level - it's difficult to recommend one when there's so many!

    [www].noupe.com/jquery/excellent-jquery-navigation-menu-tutorials.html

    css-tricks.com/simple-jquery-dropdowns/

    smashinghub.com/simple-jquery-drop-down-menu-tutorial.htm

    The forums could definitely be coded in PHP but this would be a MASSIVE task. A lot of people, myself included, would probably just choose to use one of the many free forum software packages that are currently available:

    vanillaforums.org/
    [www].yabbforum.com/
    [www].simplemachines.org/
    [www].phpbb.com/

    You should definitely try and learn as much as you can, just don't get disheartened when you see how many different scripting and programming languages are used on the web and how long it would take to learn enough to be able to do everything you wanted from scratch. You could probably make a simple html and css website today but coding even the simplest of php forums for it would be a huge step forward.

    Learning HTML, CSS, JavaScript/JQuery and PHP would be more than enough to spend the rest of your life making websites, but some people might decide to specialize in just one of those.

    It's reasons like this that wordpress is so popular and so many forums look kinda similar. Knowing enough php to create your own forum would be great, it's just that not knowing it doesn't have to stop you from trying some of your ideas out in the meantime.

    Have fun and enjoy life!
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Regarding PHP vs. HTML


    Some of the difference of PHP Vs HTML:

    1. PHP is similar to HTML. Because PHP having both HTML and PHP code.
    2. HTML is a Tag language but PHP is a scripting language.
    3. The output of PHP is mostly in HTML code. Because the web browser only sends HTML codes and PHP code always in background.
    4. Actually web page takes two numbers, add it and present to user which easily done by PHP but which is not possible in HTML.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    16
    Rep Power
    0
    In addition, php creates a dynamic pages in which you can implement call to action, respond according to user response and many more...
    html pages are just static pages which appears same to everyone who access them.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    9
    Rep Power
    0
    In PHP,you can put HTML codes.
    In HTML,you can't put a PHP code.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    17
    Rep Power
    0
    First of all what is php?
    A: php is a programming language used used on servers and only on servers.
    How does it work?
    A: when your computer ask for a file on a server the server responds with the file that could be php html, jpg, png, or anything for that matter. A php file is like a html file but does show the php code unless it displays something.
    Satch as:


    <h1>hello world</h1>
    <!--html code-->
    <?php

    //php code
    $a=2+2;
    echo "2+2=".$a;

    ?>
  20. #11
  21. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,247
    Rep Power
    1469
    Webpages are sent to the client browser as HTML (a textual representation of a website). PHP is a server-side method of dynamically creating that HTML.
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Location
    usa
    Posts
    4
    Rep Power
    0
    Originally Posted by brandan
    First of all what is php?
    A: php is a programming language used used on servers and only on servers.
    How does it work?
    A: when your computer ask for a file on a server the server responds with the file that could be php html, jpg, png, or anything for that matter. A php file is like a html file but does show the php code unless it displays something.
    Satch as:


    <h1>hello world</h1>
    <!--html code-->
    <?php

    //php code
    $a=2+2;
    echo "2+2=".$a;

    ?>
    very good work
    thanks alot
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    22
    Rep Power
    0
    Html and Php both are same.

    I thinks that are not need to compare
  26. #14
  27. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Location
    Chennai
    Posts
    6
    Rep Power
    0

    PHP Vs HTML ?


    PHP is an server side.HTML is an Browser side.HTML to makes up the basic content of the page,But php enables the page to 'react' with conditions, and adapt the HTML accordingly.

IMN logo majestic logo threadwatch logo seochat tools logo