Skip to main content
Participant
May 21, 2010
Question

Getting Server Side Directory Path in Sync? New Dreamweaver User

  • May 21, 2010
  • 1 reply
  • 507 views

Hello,

I am brand new to Dreamweaver. For the past 10 years, I've been using WS_FTP LE to transfer files from my computer files to the web and hard-code raw HTML/PHP/MYSQL into Notepad.

Now I am using Dreamweaver to try creating a PHP site and I want to use "PHP Include" statements. For instance, I have a 100 page site with a sidebar and I want to add this statement to put the sidebar on every page and be able to update it instantly at one file location:

<?php include("/home/.amenhotep/hosting-user-name/mywebsite.com/sidebar.php"); ?>

This statement works correctly on the webserver but it does not work on Dreamweaver because of the filepath. I have to use the exact code above in order to get it to work on my hosting service (Dreamhost.com).

Can someone tell me the proper way to work with Include statements with PHP and get everything in Sync between my computer and the webhost?

Thanks

Regards

This topic has been closed for replies.

1 reply

wickland1Author
Participant
May 21, 2010

Also, I have some more additional information. I followed what David Powers said here: http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html

I do have XAMPP set up on my computer at this pathname: C:\xampp

I was also able to get it to work as a server so PHP works properly.

I am just confused on the proper management of filepaths in setting up PHP Includes and getting them in sync between Dreamweaver and the website so the website works the same both on my computer and on the web.

wickland1Author
Participant
May 22, 2010

Nevermind, I think I figured it out but my question becomes evolved to something else.

It works fine if I stay consistant with a single domain name and I set up my include file to be something like:

<?php include("sidebar.php"); ?> or  <?php include("../sidebar.php"); ?>

What if I want to include a PHP file located on another domain so I can have the same template over 30 different websites? As another example, I may want to use a dealer zipcode locator tool across 30 different sites but have a single database and file located on just a single domain name.

David_Powers
Inspiring
May 23, 2010

wickland1 wrote:

What if I want to include a PHP file located on another domain so I can have the same template over 30 different websites? As another example, I may want to use a dealer zipcode locator tool across 30 different sites but have a single database and file located on just a single domain name.

For security reasons, allow_url_include is turned off in PHP 5.2 and later.