Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
I've shown you so far how to execute PHP code on the server and then how to look in the browser to see what's returned from the server to the client. You can also do this in Dreamweaver using a feature called Live Code. For this demonstration, I'll use a set of files in the chapter 02_gettingstarted and in the folder 06_liveview. I'll set my site to point to that folder, and then I'll open the file variables.php. This file has a bit of PHP code at the top that sets a variable named welcome, and then down in the content area of the page, there is another PHP command that uses the echo command to output the value of the variable.
When I click the Live View button on the toolbar, Dreamweaver copies the PHP file over to the server folder, and then shows the resulting output in Design View. Let's take a look at the Live Code feature. The Live Code feature shows the resulting output in Code View. This is very similar to what you get in the browser when you say you want to view the source, but you see this all right here in Dreamweaver. I'll click Live Code, and now take a look at the result.
The initial PHP command up at the top of the page is stripped out, and the PHP command that's outputting the value of that variable is replaced with the resulting text. Now, I'll turn off the Live Code feature, and I'll see the original PHP commands, and turn it back on and see the output text. So the purpose of the Live Code feature is to allow you to see the resulting HTML that's generated at the server, by the combination of your HTML markup, your Cascading Style Sheets, and your PHP commands.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 74465 Viewers
80 Video lessons · 129695 Viewers
52 Video lessons · 63939 Viewers
59 Video lessons · 49720 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.