Jump to content

Include And Require Files In Php


Recommended Posts

Welcome! ;)


This probably belongs in a different forum, but I think I can help anyway.


It sounds as if you are trying to send a header after some output has already been sent to the page. If I am mistaken, please correct me.


Usually this happens when there is an extra line in the include file that just happened to show up during the transfer or edit. It's a weird thing, but it happens to me all the time.


Check the bottom of your include file to make sure there are no extra lines after the PHP close tag "?>" at the bottom of your include file. None, nada, zip. Otherwise a blank line is being included.


For some reason, Cpanel File Manager loves to add an extra line or two when I edit my files. Other software may do it too, for all I know.


If you PM me your URL, I can take a look if you like.




Link to comment
Share on other sites

I had the same problem with TCH without using include or require. My fix was to add

>php_value display_errors 1

to the end of the .htaccess in the folder of the offending script. It can be a fairly common error in PHP with many server setups ;)



EDIT: BTW I was not setting ANY hedder information in the offending script. I am not " ignoring the error may correct it on-screen"

Link to comment
Share on other sites

It seems that you're sending HTTP header information (for instance, a content-type declaration) after you've already output some data. I had a similar problem with some of my scripts. While ignoring the error may correct it on-screen, it may also prevent the header from being sent, which may cause other problems. Check your PHP and make sure that you are sending HTTP headers _only_ before you send any other information at all. If that isn't clear, post some of your code here so we can see what sort of problem you're having.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...