Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
I would now like to introduce you to PHP. And PHP is our server-side language we are using for this course and Dreamweaver 5, beginning with Dreamweaver 5 and version 5.5, which is the version I'm using, began to add additional support for PHP moving forward. So five version, CS5 of Dreamweaver offered some new PHP features and CS 5.5 does the same.
So I'll point those out as we move through this course. That does not mean you can't use earlier versions of Dreamweaver. But there's little feature to assist you in PHP with these newer versions. But let's take a look at the difference between an HTML page and a PHP page. What exactly is the difference? I get asked that question quite often in class. So, we will create a new HTML page and let's give this a name.
I'll save this in our course files as html.html. So there is our HTML page. Whoops, HMTL. Now, I'll show you this. This is what happens if you don't give your page a proper extension. Notice all of my text is black and that is my signal that there's a problem on this page. I also don't have access to Design and Split View. Now, in order to fix this I'm going to close up this page and I can go right in the files panel here to fix it. So the Files panel comes in handy, I can fix it here, and we'll open the page back up, and you'll be able to see what happens.
So the icon is not the same as these pages right now. If I open it, now, you can see I have two colors of blue and black in my color coding. That's my signal my page is set up correctly. So there is my HTML page. HTML coding on it and let's add a word. Let's say, this is an HTML page, and we also have to put our proper programming term in here. When you learn a new programming language, Hello World is usually one of the first statements you make in that language.
We're not quite to PHP yet, but we'll start here. So we'll do a Save. Our page is still an HTML page, and I'll close it up. Now, what happens, if I change this file extension from HTML to PHP. I'll open that page now, and you can see the page opens, and I get this little purple kind of glowing bar, and that's the new feature in CS5 and 5.5. That also helps you with your coding.
So, this turns a different color if there's an error on your page. Now, what's the difference between this page and the HTML page. Well, let's put it in the browser and see. Absolutely nothing. A PHP page is still an HTML page. But what the PHP file extension does is tell PHP to go through the page and process any PHP coding. If you don't have any on the page, that's fine. It doesn't matter, PHP just won't process anything, but this PHP file extension tells the web server, don't serve this page up to the user right away.
You need to send this page to PHP to be processed before it goes back to the user. So, PHP does its processing, sends it back to the web server, and that's the point when the web server sends it back to the browser. Now, if we want to do some PHP coding within our page, we do have this PHP tab up at the top and these are a lot of PHP items.
It's just Dreamweaver making it easy for you to be able to add code, because Dreamweaver adds parts of the code for you. We'll take a look at starting to work in PHP coding in another file. I just wanted to show you that a PHP code is exactly the same as an HTML code, and PHP pages do not have to have PHP processing to be done on them. If there isn't any processing, no processing occurs and the page goes back to the web server as usual. If there is processing, PHP goes through, processes those code blocks that need it and then send it to the web server.
So that is working with PHP pages. The only distinction is giving it a .php instead of a .html. So that's the only distinction between our PHP pages and HTML. We will keep our entire site set up as PHP. It's generally easier to do that. That way, I'm not changing the file extension. If I need to add some PHP coding to the page, everything is already set up for the that. So there you have, a PHP page, which is really just an HTML page also.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101476 Viewers
61 Video lessons · 88227 Viewers
71 Video lessons · 72109 Viewers
56 Video lessons · 103869 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.