jim.davidson Posted July 10, 2007 Share Posted July 10, 2007 I have a copywrite that I want to include on my site I wrote a some code and called it copywrite.php My question is...does it matter where I place <?PHP include('copywrite.php');?> on the page? Should I put it at the very beginning of the code, inside the <head>, inside the <body>, or does it make absolutly no difference where it's placed? Just wondering if it makes a difference. Thanks Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted July 10, 2007 Share Posted July 10, 2007 When you include a file, it is parsed as if the contents of the included file was already in the file that is calling your include, and is wherever you call it. Therefore, the placement depends on what it does. For example, if it were to output some text(Copyright jim.davidson 2007 for example), then you'd obviously want to include this wherever you wanted the copyright notice displayed. Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 10, 2007 Share Posted July 10, 2007 It depends on what's in the file and where you want it to appear. Whatever text, code, etc. is in that file will be placed exactly where you put the include. index.php: <?php echo "world"; include "hello.php"; ?> hello.php: <?php echo "hello"; ?> Will show: world hello Quote Link to comment Share on other sites More sharing options...
jim.davidson Posted July 10, 2007 Author Share Posted July 10, 2007 I understand what you're saying but what if, as in my case the include file (copywrite.php) says where the placement is i.e. a layer? That's why I wondered if made a difference where it's placed in the code. The reason I'm asking this is that I'm getting an error on my site but so far the error only shows up on two of a dozen different pcs that I've ran it on. (CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers). I'm grasping at straws trying to come up with a reason for the error. By the way the error only happens with IE6 or IE7, Firefox and Netscape works fine on all pcs tested. Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 10, 2007 Share Posted July 10, 2007 So you have code? And you get an error? You should probably say that at the beginning and show some code. Quote Link to comment Share on other sites More sharing options...
jim.davidson Posted July 10, 2007 Author Share Posted July 10, 2007 The reason I don't show the code is that the error pops up at different times on different pages of the site. One time you'll click on a link and it works fine, 30 seconds later, click on the same link and you get the error - CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. go to another page on the site, come back, click on that link again and it will work fine. But so far it's only happens on two different pc's one running IE6 the other running IE7. Run on these pc using Firefox or Netscape can't get the error. Try it yourself www.bobtracyinsurance.com/index.php, see if you can get an error. I gladly post the code for the whole site, but I don't think that would be welcomed since there are fourteen different pages and the error could/has popped up on any of them. I would be very grateful for any ideas on what's causing this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.