Forum Moderators: coopster

Message Too Old, No Replies

How does PHP differ from HTML?

Want to add video to a PHP page, and I just know HTML

         

LABachlr

12:20 am on Sep 6, 2006 (gmt 0)

10+ Year Member



I just need to add some video clips to a simple PHP page. I took a look at the coding on the page in Dreamweaver, and it does not look that much different from HTML.

What should I know about PHP before I do this?

eelixduppy

12:27 am on Sep 6, 2006 (gmt 0)



If you are just going to add HTML to the script, then don't add any HTML between <?php (or <?) and?>. If you have to, then just close the tag (?>) and write your HTML, and then start the php (<?php) again.

You may find the Basic Syntax [us3.php.net] documentation helpful.

Good luck!

halfbug

6:22 pm on Sep 7, 2006 (gmt 0)

10+ Year Member



Php have much differences then HTML

abbeyvet

6:35 pm on Sep 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP is much different to HTML.

BUT

a page with a .php extension is not necessarily any different at all. It may be written in anything from 100% php to none at all, just containing html. In many cases it is a mix of the two, and the html in there is the same old familiar stuff.

smells so good

6:50 pm on Sep 7, 2006 (gmt 0)

10+ Year Member



HTML is a markup language that's designed to display text or images on a web page. HTML gives you the ability to format and layout your page though a variety of attributes.

PHP is a programming language. With PHP you can access a database, make decisions (programming logic), and even display HTML markup.

Here's a little sample. First is a very simple HTML document.

sample.html
<html>
<body>
this is text on the web page
</body>
</html>

Great! But I want it to be a php page. No problem, here's the same page as you might write it with PHP.

sample.php
<?php
echo "<html>
<body>
this is text on the web page
</body>
</html>";
?>

The difference is that you are using the echo function of PHP to display your HTML markup. If you were to view the source for that page (from your browser) you would not be able to see the actual PHP code, only the echoed markup.

I know that doesn't really help you add a video to your page. With regards to that, you should be able to insert yout code via DW and have it work. If you're manually editing the page, you just need to make sure that you are echoing or printing your HTML.