Php Includes Across Sub Domains

I have a site <!-- w --><a class="postlink" href="http://www.mysite.com">www.mysite.com</a><!-- w -->. />I have 3 subdomains sub1.mysite.com, sub2.mysite.com and sub3.mysite.com.<br />sub3.mysite.com is password protected.<br />All pages end with .php (ie index.php)<br />I use the following code:<br /><br /><?php<br />include("inc23.inc");<br />?><br /><br />I find that I will require some of the same includes in more than one subdomain.<br />Can I do the following?<br /><br />1) Create a subdomain called resources.mysit.com with 3 folders - images, includes and stylesheets<br />and use<br />A.<br /><?php<br />include("resources.mysit.com/includes/ inc23.inc");<br />?><br />B.<br /><link rel="stylesheet" type="text/css" href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"resources.mysit.com/stylesheets/stylesheetraw.css" /> Instead of<br /><link rel="stylesheet" type="text/css" href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"stylesheetraw.css" /><br />C.<br />In my style sheet use<br />#toparea {background-image: url(resources.mysit.com/images/images/gs1.gif); etc instead of<br />#toparea {background-image: url(images/gs1.gif);<br />D <br />do I use <!-- m --><a class="postlink" href="http://">http://</a><!-- m --><br />Since I have an absolute address instead of a relative one, I assume it doesn't matter what's where<br />E<br />Does the fact that one of my subdomains is password protected complicate anything?<br /><br />Thank you<!--content-->
I don't think you can do that, as far as I know our php config doesn't allow for calling URLs in includes.<br /><br />I can't really think of anyway to do this other than using a full path - /home/username/public_html/resources/images... etc <br /><br />I think that would work, anyway.<!--content-->
<!--QuoteBegin-TCH-Lisa+Jan 27 2005, 08:05 PM--><div class='quotetop'>QUOTE(TCH-Lisa @ Jan 27 2005, 08:05 PM)</div><div class='quotemain'><!--QuoteEBegin-->I don't think you can do that, as far as I know our php config doesn't allow for calling URLs in includes.<br /><br />I can't really think of anyway to do this other than using a full path - /home/username/public_html/resources/images... etc <br /><br />I think that would work, anyway.<br /><div align="right"><a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=110514"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Would the fact that one of the subdomains is password protected affect that subdomains ability to access another sub domain or the other subdomain to send to a password protected calling subdomain?<!--content-->
I have no idea, easiest thing to do is try it. =) I don't have a setup where I can try test that at the moment. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /><!--content-->
Answering your questions in reverse order... <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /><br /><br />E - I don't think so. Unless you try to access something via <a href="http://subdomain.domain.com" target="_blank">http://subdomain.domain.com</a><br /><br />D - If you want to use the absolute URL then you must use the <!-- m --><a class="postlink" href="http://">http://</a><!-- m --><br /><br />C - That would work but you'll need to use http:// in the beggining of the URL (see D)<br /><br />B - Same as C<br /><br />A - Ah, the complicated one, finally: No. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /><br />Seriously, this is the most complex one to answer. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><a href="http://www.totalchoicehosting.com/forums/index.php?showtopic=10337&view=findpost&p=68879" target="_blank">Read my post about why using include("http://somedomain.com/include.php") will not work</a>.<!--content-->
 
Back
Top