Viewers: in countries Watching now:
Join author David Gassner as he describes how to add dynamic data to a PHP-enabled web site in Adobe Dreamweaver. This intermediate course shows how to plan and create a MySQL database, define a PHP-enabled site in Dreamweaver, connect the site to the database, and manage and present dynamic data. David also explores Dreamweaver features such as PHP custom class introspection and site-specific code hinting as well as the differences between the CS5 and CS6 versions of the software.
This course was updated on 6/12/2012.
Dreamweaver gives you the ability to insert simple PHP commands fairly automatically, using either the menu or the Insert panel. For this demonstration, I'll use files in a copy of this site in the folder 02_gettingstarted > 04_insertphpcode. And I'll work with this file, helloworld.php. This file already has a .PHP extension and when I look at it in Live View, which results in copying the file over to my server folder, and browse the file through the localhost URL, I'll see that the file is shown with the simple text "Hello World" in a content area.
I'm going to show you how to replace that literal text with a simple PHP command.
Here is the text inside a pair of
I'm going to remove that text, and then I'm going to use one of the most
fundamental PHP commands,
the echo command, to output a literal string into the browser.
To do this from the menu, select Insert > PHP Objects, and then choose Echo, or if
you prefer, you can use the Insert panel, switch to the PHP category, and then
once again, choose Echo.
I'll click once on the Echo selection. That inserts a PHP code block and adds the echo command. After the Echo command, you can add to the echo command any literal string or any variable or dynamic expression that will evaluate to a string. I'm going to pass in the value Hello World, wrapped in quotes. I'll save my changes and then I'll look at the file again in Live View. I'll exit Live View and then, enter it again. Notice that the file was once again being copied to the testing server, and then I'll go to Design View, and I'll see exactly the same text output.
Now to see this in an external browser, I'll go to the Browser button in the toolbar, and I'll select my favorite browser - I usually use Firefox for testing - go through the copying dialogs, and once again there is the output. Now, here is the important thing to understand about the echo command. I'll look at the Page in the Source View, and here is the text that's being output by the echo command. By the time gets to the browser, it's just text. I'll go back and make a simple change to the code.
I'll go to the Code View, and I'll change the text to Hello World from PHP. I'll browse the page. If prompted, I'll say Yes I want to save the file, and I want to copy it. And now the text is output in the browser, exactly as I typed it in the echo command. And once again, I'll show you Source View and show that that's the text that's output, and that the browser receives simple text. Again, the important thing to understand about PHP and all web application servers is that the commands that you execute that are a part of the server-based language, such as PHP, are executed on the server, and the browser doesn't know anything about them.
The browser receives the resulting HTML markup, including any text that you output.
Find answers to the most frequently asked questions about Dreamweaver with PHP and MySQL .
Here are the FAQs that matched your search "" :
<?php include('../ZendFramework/library/Zend/Date.php'); ?
<?php echo $_SERVER['DOCUMENT_ROOT']; ?
You can then programmatically modify the include_path variable at runtime with the set_include_path() function. For example, if your physical root folder is /home/myroot, the code might look like this:
<?phpset_include_path('.' . PATH_SEPARATOR .'/home/myroot/ZendFramework/library/Zend');include('Date.php');?
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.
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.