Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Getting Server Side Directory Path in Sync? New Dreamweaver User

New Here ,
May 21, 2010 May 21, 2010

Copy link to clipboard

Copied

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

TOPICS
Server side applications

Views

463
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2010 May 21, 2010

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2010 May 22, 2010

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 23, 2010 May 23, 2010

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 26, 2010 May 26, 2010

Copy link to clipboard

Copied

LATEST

Thanks for the reply. Do you know of another way to do something like that?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines