Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,900 courses, including more Business and personalized recommendations.Start Your Free Trial Now
- View Offline
This course was updated on 6/12/2012.
- Understanding dynamic versus static content
- Adding PHP commands to web pages
- Setting and outputting variables
- Using server-side includes
- Creating PHP custom classes
- Adding the Zend Framework to a PHP installation
- Creating a MySQL database
- Adding data in phpMyAdmin
- Building recordsets
- Formatting dynamic data
- Building data entry forms
- Authenticating users
- Deploying a dynamic site
Skill Level Intermediate
Once you've configured and tested your FTP connection, you can upload your entire site to the remote server with a single step in the Files panel, or from the menu. I'll work primarily with the Files panel in these exercises. I'll go to the Files panel, and I'll select the Site header. This is the item in the tree at the very top that shows the site name. And then you can either right-click on that item and choose Put, or you can click the up arrow in the toolbar, which means the same thing.
When I click the button, I'm asked whether I want to put the entire site onto the remote server. I'll click OK, and I'll see that the files are copied very quickly. Now, I'm working with an FTP Server on my local computer, and so the copying is incredibly fast. When you're working with an actual remote site, you'll see that it takes quite a bit longer. Now, to make sure that files have been copied correctly, I'll go to the Files panel and choose Remote Server, and I see that all of the files and directories have been successfully copied over.
Then I'll go back to the Local View. You can also use synchronization. When you synchronize, Dreamweaver checks the file names and time-date stamps for the files on the client and on the server, and then tells you which files have to be copied. I'll demonstrate this with the file phpinfo.php. I'll look at the code for this file. It sets a time zone, indicates the current time, and then outputs the result of the phpinfo function.
I'm looking at the file in my testing site, which is located in the dwwithphp folder. I'll change this URL to indicate that I want to look at the remote site, and I'll see that the output is exactly the same. It's two different copies of the page: one stored on the testing server, one stored on the remote server. Now I'm going to make a change to the file. I'll go to the code right before phpinfo, and I'll type echo and then an h1 tag wrapped in quotes, and then using a period to concatenate, I'll append PHP Info, another period, and then in quotes a closing h1 tag.
I'll save my changes and run the page in the browser using the Preview button, and I'll see the new h1 tag appear, and I'll note that I'm still working in the testing server. I'll change to the remote server, and I'll see that that version doesn't have the change. Now, I'll go back to Dreamweaver. To synchronize, I'm going to right-click on the site heading and choose Synchronize. You can also click on a button on the toolbar. The Synchronize Files dialog box asks me which direction I want to synchronize in.
The options are to put newer files to remote, get newer files from remote, or to do both Get and Put operations at the same time. I'll choose the default, putting newer files to remote. I'll Preview, and after a very quick moment, Dreamweaver indicates that the phpinfo.php file is needed. There is another file here that it picked up that I don't want to put onto the site. I'll click that, and then click the Ignore button, which looks like a little stop sign.
I'll click OK, and the file is very quickly copied to the remote site. I'll switch back to the browser, which is showing the PHP Info page on the remote site, and I'll just refresh, and I'll show that the change appears. I now see the new text that I had changed in the local site, because it has been synchronized to the remote site. When you use the synchronization function, you can either do it for the entire site, as I showed here, or you can do it for one folder at a time, or one file at a time.
Just select the file, folders, or site that you want to synchronize, and then start the synchronization function. It's also worth noting that in your Exercise Files directory, you'll have a new set of files, called dwsync.xml. This file appears in the notes subfolder of every physical folder of your site. It's an XML file that tracks all of the files in your site, and includes information about the local copy, the remote copy, and the date-time stamps expressed as integer values, indicating which version is which, and how they might differ.
The dwsync.xml file is used by Dreamweaver to handle the synchronization process. If you have any troubles with synchronization, you can simply wipe out the dwsync.xml files from your entire structure. Remember, there are multiple versions of dwsync.xml, one in the notes subfolder of every site folder. After you've gotten rid of those XML files, re-put everything onto your remote site, and the synchronization files will be recreated for you.
So that's a look at how to work with the remote site using the FTP capabilities of Dreamweaver CS5. You can put files, folders, or the entire site onto the remote site, or you can synchronize, automatically detecting changes in the local files, and copying only those files to the remote site as needed.