Skip to main content
Participant
November 21, 2011
Answered

pages from template now get syntax error

  • November 21, 2011
  • 2 replies
  • 1161 views

This may not actually be a PHP question, but I know the use of PHP will muddy getting help in the general forum. I am at my wits end on this.

In my sites, in which I always use a Template, for years, I have successfully used the following code:

<?php
include ('../inc_debmenu.html');
?>

However, this now fails me. Not because of the code itself, but due to a path-writing issue.

I should note that I recently moved to a new Mac, and the new Mac's hard drive has a new name — 2 words now, rather than one. I imported the site definitions though and I have no problem updating existing pages or sites that don't use includes, so I don't believe that's an issue. Unless the 2-word HD name is an issue in PHP.

The problem is that in all of my sites that use this include, when I create a new page from my Template, I get an error and the pages won't render when uploaded. Before saving the newly created page, my paths are /// as you'd expect. But even after saving that page to the root of my site, I have the same paths. After the save it reads:

<?php
include ('file:///Deb's Traveller/Users/deb/Documents/websites/MAMPFILES/htdocs/DebSite2010/inc_debmenu.html');
?>

I should add that I use MAMP and have it running, but the issue is the same with it running or not. (You may see that I changed the default location for backup reasons. I have always done that.)

I use: DTD XHTML 1.0 Transitional//EN

What I have tried:

  • Under Site Setup->Site, I reselected my site's folder.
  • Under Site Setup->Servers Advanced, I have both my testing and remote set up and for both, I have tried both no server testing model and the PHP option.
  • Under Site Setup->Templates->Advanced I tried having the Don't rewrite relative document paths option checked and not checked. (At this point I don't recall what is normal to have. I think I used to not have that checked.)

Anything else I should be telling you?

I sure hope someone here knows what I am doing wrong and can tell me, or can figure this out. I've lost far too many hours seeking the solution on my own. In case it helps to see the site, it's <http://www.Shadovitz.com>. But all pages were added on my old Mac, before the problem.

Hoping...

Deb Shadovitz

This topic has been closed for replies.
Correct answer MurraySummers

Is it possible that having a hard drive have the apostophe is killing me? That wouldn't make sense because people have been doing that on the Mac for years .

Definitely. Which is why I asked what the name is.

2 replies

MurraySummers
Inspiring
November 21, 2011

I should note that I recently moved to a new Mac, and the new Mac's hard drive has a new name — 2 words now, rather than one.

What is that name?  Does it contain punctuation?

DSxenaAuthor
Participant
November 21, 2011

Hi Murray

The template name is DebMainPage.dwt.php and it's in a folder called Templates. The template worked fine until I copied all the files to a new machine with a different name. I never renames the Templates folder or changed paths within the hard drive. I have a folder called websites, then MAMPFILES, then htdocs, then DebSite2010. I was careful to recreate those folders on the new Mac.

The template is seen. When I go to the File-New dialog box it is there to select and it gets made and all looks in place. Only saving doesn't seem to identify the path.

I've thought about re-linking to the included files (inc_debmenu.html and inc-disclaimer.html) but fear messing up all of my existing pages. Is that the most logical thing to try?

Is it possible that having a hard drive have the apostophe is killing me? That wouldn't make sense because people have been doing that on the Mac for years .

DSxenaAuthor
Participant
November 21, 2011

I could add that I also used a template conditional that still works fine.

The template's code (I added line breaks so you could follow it more easily):

<!-- TemplateBeginIf cond="Strip_Deb" --><img src="../skin/DebStrip.png" width="537" height="90" alt="DebPictures" /><!-- TemplateEndIf -->

<!-- TemplateBeginIf cond="Strip_Mac" --><img src="../skin/MacStrip.png" width="537" height="90" alt="Mac stuff" /><!-- TemplateEndIf -->

<!-- TemplateBeginIf cond="Strip_NY" --><img src="../skin/NYStrip.png" width="537" height="90" alt="NY pics" /><!-- TemplateEndIf -->

<!-- TemplateBeginIf cond="Strip_Travel" --><img src="../skin/TravelStrip.png" width="537" height="90" /><!-- TemplateEndIf -->

<!-- TemplateBeginIf cond="Strip_LA" --><img src="../skin/LAStrip.png" width="537" height="90" /><!-- TemplateEndIf -->

The page from the templates code:

<img src="skin/TravelStrip.png" width="537" height="90" />

DSxenaAuthor
Participant
November 21, 2011

Adding to what I've written above, the code from the Template SHOULD read:

<?php

include ('inc_debmenu.html');

?>

The Template is behaving properly with regard to paths to the images on my page. Just not to my PHP code. Editing the two PHP bits in BBEdit allows the page to render online. However, that's not a true solution.