vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Getting past "Header already sent" errors (https://vborg.vbsupport.ru/showthread.php?t=82104)

cinq 05-27-2005 01:37 AM

Getting past "Header already sent" errors
 
I am trying to put this:
PHP Code:

header("Content-type: image/png"); 

in a file edit so that i can display a generated thumbnail but it sends out a "header already sent" error.

Is there any way i can get past this ?
Much thanks in advance. :)

Andreas 05-27-2005 02:26 AM

Check for blank lines before <?php, this is the most common issue.
Are you trying this within vB?
Then cookies might be an issue.

cinq 05-27-2005 02:34 AM

Yep kirby... adding my code to functions_bbparse.php actually.

cinq 05-28-2005 03:14 PM

anyone ? :(

Marco van Herwaarden 05-28-2005 03:45 PM

I don't think you can send a header after the body has started. But i am not a html guru.

Trigunflame 05-28-2005 04:25 PM

headers sent by header() are not HTML headers, they are HTTP headers which are sent in the "Header" of the HTTP reply back to the client.. ie.

your browser sends something like

GET / HTTP/1.1
Host: vbulletin.org
Connection: keep-alive

Server sends something back like

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 5
Content-Type: text/plain

Jebus

So if you are getting that error, it means you have already outputted some sort of data, either intentionally or unintentionally..

Rule of thumb is, always output headers with header() before you ever output anything.


All times are GMT. The time now is 07:01 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01243 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete