Welcome to WebmasterWorld Guest from 22.214.171.124
So the Help Center offered what looked like a pretty good start on how to set this up for PHP:
1) I created the analyticstracking.php file (updated the account # of course) and just to be safe, I uploaded to both
/public_html AND /public_html/php
2) Next -- I couldn't find anything that looked like a footer, so I had to add this line to every template page:
And the directions say to add it before the </body> tag. But that's the problem; as far as I can tell, these are the template pages:
3) And here I find two problems.
a) These files don't seem to have </body> tags. Am I wrong in assuming that these are in fact the template files?
b) I backed these up and renamed the originals -- and the site was still reading them! In other words, those with the original filenames were sitting on my hard drive, and the backed up versions had new names that the PHP file ought not to be able to read. But it could!?!?! What gives?
I'm dying here. If anyone knows anything about this, I'd be forever in your debt.
[edited by: jatar_k at 5:16 pm (utc) on Aug. 11, 2007]
[edit reason] no urls thanks [/edit]
Your site probably has a couple main files which run the whole show. Those files will contain the </body> tag and only request the necessary template for the content on a given page.
Get a program like notepad++ that can open multiple files in tabs, open up ALL of the files for your website and run a search for the </body> tag in all files at once.
I backed these up and renamed the originals -- and the site was still reading them! In other words, those with the original filenames were sitting on my hard drive, and the backed up versions had new names that the PHP file ought not to be able to read.
How were they renamed? example.php to example.php.2 won't be an executable PHP file. The correct way to rename it is to put example.php as example2.php.
You might already know this, but that seems to be the reason why the file can't be an executable PHP file after renaming.
but that seems to be the reason why the file can't be an executable PHP file after renaming.
I didn't get the impression from the post that the files were no longer executable. I got the impression that he renamed the original files and uploaded new versions of them yet nothing seemed to change on the website as if the files hadn't been renamed/edited at all.
I asked if it was a pre-built content management system because some of them have a page caching feature which could create the illusion of old files still being included. However, I don't think any of them will cache a page for more than a few minutes so this explanation seems unlikely.
What is more likely is that the files that are actually being included by the website are not the same ones he is editing.
and just to be safe, I uploaded to both
/public_html AND /public_html/php
You don't need to upload an included file to two places "just to be safe". It's one or the other. Find out which one is the proper location and delete the other one immediately or you will confuse yourself down the road.
as far as I can tell, these are the template pages
And those mentioned as templates, don't sound like they are templates to me.
Get a local copy of the whole site, open it with an editor (Dream Weaver, Zend Editor or anything), and then search for "</body>" as mentioned by SixTimesEight. You might need to look for a logical footer name or open the pages and see what pages they include at the very bottom.
And again like suggested, I can't stress enough on this, never leave copies of the same file in the server for the reasons of safety or anything, keep the site clean as it can allow you to find and edit files easily in the future.