Welcome Guest, Not a member yet? Register   Sign In
Message Cannot modify header information - headers already sent
#1

[eluser]Rubiz'[/eluser]
I tried to use Upload class again with PHP 5.2 it didn't work again, I copy + paste User guide exemple without changing any single word, my folder was with 777 permission, in the site root, and it didn't work... Always returning invalid path.

My friend is calling me upload troubled girl Smile

Well, but I made my own upload functions in a helper.

It works nice, but now I'm catching this message:
Code:
Cannot modify header information - headers already sent by (output started at /home/miolos/www/site_novo/system/helpers/uploading_helper.php:40)
I ve had this kind of message when working with cookies... never had with upload functions...

Anyone could help me resolve this?
#2

[eluser]Phil Sturgeon[/eluser]
There is something being output in your helper. This could be an error that is not being caught properly or it could be some whitespace outside of the <?php ?> tags. Remove all whitespace and if you still get the problem then paste up the lines around line 40 so we can see whats wrong.

When you want errors fixed here, the message is not as helpful as it would be with the actual code.
#3

[eluser]nirbhab[/eluser]
Quote:If you have access to output_buffering in php.ini file, change it to "On". You won't ever get this error.
else do as thepyromaniac says.
#4

[eluser]Rubiz'[/eluser]
I didnt know about whitespaces! I'll verify this.
About paste up other line I didint understand...

Well, I resolved the problem when I changed the uploading helper from autoload to each page who upalods... but I really like concentrate all helpers in autoload, and I dont have permissions to change php.ini settings... but, I'll be doing this things friends.

Thanx!
#5

[eluser]tonanbarbarian[/eluser]
99 times out of 100 it is a blank line AFTER the closing ?> tag at the end of the file.
I have posted about this before (too lazy to try to create a link to it) but to summarize what I said... just do not use the closing ?> tag in the file if there is nothing coming after it. It will marginally speed up your code and will mean you never get the above issue.

If you are interested in some more explanation as to why and also some other tips on coding standards just search through my posts, there are a couple of posts about it from late last year
#6

[eluser]rankorn[/eluser]
[quote author="tonanbarbarian" date="1200880988"]99 times out of 100 it is a blank line AFTER the closing ?> tag at the end of the file.
[/quote]

Thanks Tonan, you made my day! :cheese:

It really was a small space after the closing tag. This thing made me crazy!

Ran.
#7

[eluser]wiredesignz[/eluser]
It is acceptable coding practice to leave off the closing PHP tag.
#8

[eluser]oppenheimer[/eluser]
Awesome! I never would have found the problem of the extra blank lines. Thanks much.
#9

[eluser]marciol[/eluser]
hi,
what's wrong? (http://codeigniter.com/tutorials/ -blog in 20m)

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\ci\system\application\config\config.php:1)

Filename: helpers/url_helper.php

Line Number: 530
#10

[eluser]JoostV[/eluser]
There's output in file config\config.php on line 1. Bet ya it's a whitepace before the opening tag.




Theme © iAndrew 2016 - Forum software by © MyBB