I've posted this over at WMW, but the suggestions so far have not worked - not that the SUGGESTIONS are necessarily bad - it could be I don't know what I'm doing and I'm missing something simple...anyway, figured I'd try here, too, just in case...
SUMMARY:
How do I use includes in my pages residing in the subdomain of my main site? Naturally the includes work fine on the main domain, but I cannot figure out how to get includes to work for the subdomain pages - please read on for more details which explain what I have already tried.
THE FULL MAGILLA:
Now, I'm posting this in this section because I'm by no means a web developer, programmer, sysadmin, etc.
I do have a couple of small, active sites which hum along, and I've learned a lot in building them, but this is my first foray into the world of subdomains. *shudder*
My problem is this:
I am trying to use php includes in the subdomain pages - but cannot get them to show on the live page.
Some back-ground:
1 - I'm on a virtual dedicated server, so I have full access to "my" server.
2 - Obviously it's running php (Linux/Apache - I never know how to properly say this like "It runs Windows" ) - (I am a dumbass, I know)
3 - All includes work fine on the main website
Now, I have been at this for about 6 hours so far today and here's a run-down on what I've tried (and what has failed). I'll try to do this justice as I know a wrong character or misplaced space can cause things to go awry... (f-ing .htaccess files! I love them now, but hated them for about 3 hours one cold, dreary Sunday... LOL)
The main website is structured as such:
http://www.domain.com/file-name.html
Includes reside as:
http://www.domain.com/includes/nav.php
Images, same dealio...
Now, on the main domain, I use the following code to bring in the includes:
<?php include('includes/test_header.php');?>
Brings it in on a "relative path", if I'm using the correct terminology there.
Now, dropping this code into the test page (http://subdomain.domain.com/template-page.html) I have in the subdomain (http://subdomain.domain.com/) nets me squat.
I have the following folders created in the subdomain:
/includes/
/images/
Now, the confusing part for me is that I do actually have the php files I want included inside this /includes/ folder in the subdomain. If I type the direct path for the file into the address bar, it shows up nicely.
Images are pulled into the subdomain test page properly (from the /images/ folder in the subdomain).
I have tried the following combinations of include code and more - all of which have failed to be successful (the actual file I'm testing for is named "sc_header.php" ):
<?php include("subdomain.domain.com/includes/sc_header.php" );?> (quotes, no "http://" )
<?php include("http://subdomain.domain.com/includes/sc_header.php" );?> (quotes & "http://" )
<?php include('subdomain.domain.com/includes/sc_header.php' );?> (apostrophies, no "http://" )
<?php include('http://subdomain.domain.com/includes/sc_header.php' );?> (apostrophies & "http://" )
<?php include("http://www.domain.com/includes/sc_header.php" );?> (tried calling from the main domain's include folder - no joy - tried this with quotes & apostrophies, with and without the "http://" )
<?php include('domain.com/subdomains/nameofsubdomain/httpdocs/includes/sc_header.php' );?> (this one with quotes and apostrophies and every permutation of inclusion or removal of listed items in the path - with and without "httpdocs", for example.
Heck, I even just tried dropping the file into the root of the subdomain and calling it from there - again, zip.
I've searched threads here, at php.net and generally through Google today - nothing helped point me in a direction that worked. I did find some ideas of things I hadn't tried, but when I did try them, nada.
I came across some references to "cgi-bins", but not being a programmer, etc., I have no clue what they are, how to set them up or how to use them. I'm hoping for a simple solution to this problem, rather than a lessons in yet another new item to learn.
So, there we go folks - I'll throw myself at your mercy.
As I mentioned near the beginning of this post - I am NOT a web developer, programmer or sysadmin - it's been a long, frustrating journey to learn what I know on my own, and I am still firmly encamped in my "Noob Webmaster" status.
I'd appreciate any partical suggestions and idea that are directly applicable to solving this problem.
I clearly am missing something in my understanding of what works with subdomains...
**Please Note: in the code smaples above, I have added a space between " & ) or ' & ) as this forum makes them appears as winking smileys... In the actual coding on the live webspage those spaces do not exist.**
[ Message was edited by: SportsGuy 05/29/2006 07:23 am ]
|