Include Function Not Working

liunx

Guest
I hope this is the appropriate forum. I'm really tired this evening and not thinking very straight.<br /><br />Earlier in the day, <a href="http://www.pioneershospital.org" target="_blank">THIS SITE</a> resolved fine. It had suffered from a DNS problem, but was working as of about 6 hours ago. I left home, went to the movies, came back home, installed a new fan on cpu, ate dinner, took nap...and now all of a sudden the header and footer will not pull into this site.<br /><br />I haven't done anything to it all afternoon...so what in the world could be going on???<br /><br />Help, please...begs a sleepy, groggy little reseller!!!<br /><br />Here's my php code for the header:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php //get header file<br />    include "http://www.pioneershospital.org/inc/PHhead.php";<br />?><!--c2--></div><!--ec2--><!--content-->
<img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> I can't see anything - keeps timing out.<!--content-->
well...that's odd. I'm cleaning my cache right now...maybe I was only seeing it by fluke.<br /><br />Nope...cache cleaned and it is still coming up for me, just not with header and footer files.<!--content-->
ok...maybe it's just my php stupidity shining through, but, if the primary domain for your site is .org...wouldn't that be the appropriate thing to use in any absolute url on your site?<br /><br />I changed my php code to read .com instead of .org and now the includes are working. Why in the world would it matter? And why in the world did it work fine a few hours ago??<br /><br />Please excuse my sounding a bit put out...I'm just tired and have had multiple problems with this particular site of the past couple of days! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/shutup.gif" style="vertical-align:middle" emoid=":shutup:" border="0" alt="shutup.gif" /><!--content-->
it should work with .org since that is the domain name, the reason it works with .com is because pioneershospital.com is parked on pioneershospital.org.<br /><br />Sorry but thats about all the help I can offer, i'm useless with php<!--content-->
Thanks for looking at it, Mike. I would agree with you. However, it sure didn't work this evening. Maybe it only works between certain hours of the day, which would explain why it worked BEFORE I went to the movies!! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> Seriously, I don't understand it. The only thing I changed in the php code was .org to .com. I didn't rewrite the rest of it or anything...<br /><br />I'm clueless...but at least it's working for now!<!--content-->
if you use<br /><b><!--fonto:Courier--><span style="font-family:Courier"><!--/fonto-->include $_SERVER['DOCUMENT_ROOT']."/inc/PHhead.php";<!--fontc--></span><!--/fontc--></b><br />it will be portable and work from any place on your site<!--content-->
Don...that is actually what I use on all my other sites. However, I think I remember having difficulty getting folders and sub-folders to call the include correctly using that format. Maybe it was just my lack of php knowledge causing problems. I'm re-coding most of this site, so I will give it another try.<br /><br />Still...the problems I had yesterday don't make sense to me!!<!--content-->
Tracy, you're using URLs with the include function, which may not wield the results you were expecting. Read my posts about that in <a href="http://www.totalchoicehosting.com/forums/index.php?showtopic=10337&view=findpost&p=68800" target="_blank">this thread</a> <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Okay, Raul...2 things.<br /><br />1. How in the world did you get that thread link to go somewhere in the middle of the page instead of to the top of the page? It was like an anchor link or something...<br /><br />2. Now the real question. If my site structure is<br /><br />etc<br />mail<br />public_ftp<br />public_html<br /><b>.....index.php</b><br />.....include folder<br /><b>..........header.php</b><br />.....folder2<br /><b>..........page1.php</b><br /><br /><br />Can I use the same include method in <b>index.php</b>, which is in public_html folder, as I use in <b>page1.php</b>, which is in a subfolder of the public_html folder?? Is it better to have my include folder at the same level as the public_html folder?<!--content-->
Well...I guess I should say, "nevermind". I played with it a bit and it does work using the same path for files in the public_html directory and files in sub-directories. Maybe what I am remembering having problems with was getting the includes to work locally using phpdev. I had to use a different path because the root folder system was not setup the same.<br /><br />Thanks for the information, Raul!!!<!--content-->
Glad you got the second question answered, Tracy <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br />About the first one, it's simple, each post has an anchor. You can see it in the code and add the appropriate "#postID" to the end of the URL or, even better, click the "Posted" link that appears above each post, just before the post date. It will open a JavaScript dialog containing a direct link to that post <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Gee...thanks, man!!! I never even payed attention to that posted link...much less clicked it! Very handy!<!--content-->
 
Back
Top