Post by Captain Niobe on Oct 29, 2010 2:54:51 GMT -8
I discovered the problem, thanks to frufru and some slight looking around (if course, I had to know what I was looking for first lol).
Just for the record, and in case anyone else is having this problem, the issue was occurring because in PHP, include files being called from directories above the target page require ../ before the URL. This is repeated the same number of sub-folders down the page is, for example:
www - file/path/here.php
www/level1 - ../file/path/here.php
www/level1/level2 - ../../file/path/here.php
Ok, just thought I'd let everyone know. Thanks for reading, anyways
Hehe... I wonder if Jordan will decide to help me for the.. 4th time? ;D (no requirement, anyone who knows PHP can help if they so wish )
Ok, on slowdownstupid.niobe132004.net/ again. I downloaded a sitemap creator called GSiteCrawler with the intention of creating an XML sitemap for search engine crawlers to find and index SDS with. Unfortunately, it was only coming up with the homepage and not seeing any other links leading from it. This was due to the remotely hosted JavaScript files that contained the links, parsed via document.write('');.
So, I asked frufru about PHP include files, and how they would be used in a HTML page. Then I came to the sensible choice and made the pages in PHP instead, still using includes for remote files to handle most of the common layout.
I spent a few hours remaking the pages, after having made a common template. I copied much of the content from the original HTML pages, but checked through them for errors (and to re-format some of them where I used alot of non-breaking spaces and <br />s). Everything looked good. So, having backed up the live version of the site before the conversion (and really because the files and some of the folders were rather messy with way more than was needed in it), I deleted everything from it, getting rid of everything so I could start fresh (I had built the filetree again on the computer side with the intention of uploading the entire filetree again). Got the filetree and all the files uploaded, then started checking for 404s using GSiteCrawler. I found two, images that I'd forgotten to put in the PC version before I uploaded (BTW, in case it's asked, my FTP program is FileZilla, and my host is a paid host, strato.co.uk).
So then the next step was to go and physically visit the pages themselves, and that's where I found several pages with nothing bar page-specific content, and this warning:
(XX being the filename/linenumbers)
Working pages:
slowdownstupid.niobe132004.net/
slowdownstupid.niobe132004.net/sitemap.php
slowdownstupid.niobe132004.net/introduction.php
slowdownstupid.niobe132004.net/credits.php
Non-working pages:
slowdownstupid.niobe132004.net/crashes/graphic/
slowdownstupid.niobe132004.net/crashes/funny/20090530-unitedstates-northcarolina-topless-truck.php
slowdownstupid.niobe132004.net/crashes/funny/20100125-turkey-istanbul-truck-destroys-footbridge.php
slowdownstupid.niobe132004.net/crashes/funny/
slowdownstupid.niobe132004.net/crashes/fatal/20101022-australia-southaustralia-sisters-killed-in-car-surfing-accident.php
slowdownstupid.niobe132004.net/crashes/fatal/20101022-australia-victoria-three-dead-in-three-truck-crash.php
slowdownstupid.niobe132004.net/crashes/fatal/
slowdownstupid.niobe132004.net/crashes/nonfatal/
slowdownstupid.niobe132004.net/crashes/
(And y'know, I only just saw the pattern - all the top-level pages are working, none of the pages in sub-folders are pulling in the remote .php files... O.O)
Source codes won't show jack bar where I've put the files, look for commented out "File X"s. Here's the list of remote PHP files:
slowdownstupid.niobe132004.net/remote/template/01.php
slowdownstupid.niobe132004.net/remote/template/02.php
slowdownstupid.niobe132004.net/remote/template/03.php
slowdownstupid.niobe132004.net/remote/template/04.php
slowdownstupid.niobe132004.net/remote/template/05.php
slowdownstupid.niobe132004.net/remote/template/06.php
slowdownstupid.niobe132004.net/remote/template/07.php
slowdownstupid.niobe132004.net/remote/template/08.php
slowdownstupid.niobe132004.net/remote/template/09.php
(view source to see the coding in them).
If anyone can assist in fixing this issue (now that I've figured out which files are doing it with the obvious why ), I would be super grateful.
For the record, this is the first time I've dabbled in PHP, I'm a total newbie, so please try not to get too complicated in explaining things... Okays? Thankies! ;D
- Niobe.
Just for the record, and in case anyone else is having this problem, the issue was occurring because in PHP, include files being called from directories above the target page require ../ before the URL. This is repeated the same number of sub-folders down the page is, for example:
www - file/path/here.php
www/level1 - ../file/path/here.php
www/level1/level2 - ../../file/path/here.php
Ok, just thought I'd let everyone know. Thanks for reading, anyways
Ok, on slowdownstupid.niobe132004.net/ again. I downloaded a sitemap creator called GSiteCrawler with the intention of creating an XML sitemap for search engine crawlers to find and index SDS with. Unfortunately, it was only coming up with the homepage and not seeing any other links leading from it. This was due to the remotely hosted JavaScript files that contained the links, parsed via document.write('');.
So, I asked frufru about PHP include files, and how they would be used in a HTML page. Then I came to the sensible choice and made the pages in PHP instead, still using includes for remote files to handle most of the common layout.
I spent a few hours remaking the pages, after having made a common template. I copied much of the content from the original HTML pages, but checked through them for errors (and to re-format some of them where I used alot of non-breaking spaces and <br />s). Everything looked good. So, having backed up the live version of the site before the conversion (and really because the files and some of the folders were rather messy with way more than was needed in it), I deleted everything from it, getting rid of everything so I could start fresh (I had built the filetree again on the computer side with the intention of uploading the entire filetree again). Got the filetree and all the files uploaded, then started checking for 404s using GSiteCrawler. I found two, images that I'd forgotten to put in the PC version before I uploaded (BTW, in case it's asked, my FTP program is FileZilla, and my host is a paid host, strato.co.uk).
So then the next step was to go and physically visit the pages themselves, and that's where I found several pages with nothing bar page-specific content, and this warning:
Warning: include(remote/template/XX.php) [function.include]: failed to open stream: No such file or directory in /mnt/web7/42/80/51970780/htdocs/www/slowdownstupid/crashes/graphic/index.php on line XX
(XX being the filename/linenumbers)
Working pages:
slowdownstupid.niobe132004.net/
slowdownstupid.niobe132004.net/sitemap.php
slowdownstupid.niobe132004.net/introduction.php
slowdownstupid.niobe132004.net/credits.php
Non-working pages:
slowdownstupid.niobe132004.net/crashes/graphic/
slowdownstupid.niobe132004.net/crashes/funny/20090530-unitedstates-northcarolina-topless-truck.php
slowdownstupid.niobe132004.net/crashes/funny/20100125-turkey-istanbul-truck-destroys-footbridge.php
slowdownstupid.niobe132004.net/crashes/funny/
slowdownstupid.niobe132004.net/crashes/fatal/20101022-australia-southaustralia-sisters-killed-in-car-surfing-accident.php
slowdownstupid.niobe132004.net/crashes/fatal/20101022-australia-victoria-three-dead-in-three-truck-crash.php
slowdownstupid.niobe132004.net/crashes/fatal/
slowdownstupid.niobe132004.net/crashes/nonfatal/
slowdownstupid.niobe132004.net/crashes/
(And y'know, I only just saw the pattern - all the top-level pages are working, none of the pages in sub-folders are pulling in the remote .php files... O.O)
Source codes won't show jack bar where I've put the files, look for commented out "File X"s. Here's the list of remote PHP files:
slowdownstupid.niobe132004.net/remote/template/01.php
slowdownstupid.niobe132004.net/remote/template/02.php
slowdownstupid.niobe132004.net/remote/template/03.php
slowdownstupid.niobe132004.net/remote/template/04.php
slowdownstupid.niobe132004.net/remote/template/05.php
slowdownstupid.niobe132004.net/remote/template/06.php
slowdownstupid.niobe132004.net/remote/template/07.php
slowdownstupid.niobe132004.net/remote/template/08.php
slowdownstupid.niobe132004.net/remote/template/09.php
(view source to see the coding in them).
If anyone can assist in fixing this issue (now that I've figured out which files are doing it with the obvious why ), I would be super grateful.
For the record, this is the first time I've dabbled in PHP, I'm a total newbie, so please try not to get too complicated in explaining things... Okays? Thankies! ;D
- Niobe.